How To Script On Roblox For Beginners – Functions, Parameters & Arguments – Episode 9

34
5



The ninth video in the series of how to script on Roblox for Beginners. This time, you’ll learn how to use Functions, Parameters and Arguments to make your code more efficient and to complete specific tasks. The main idea of a function is to save yourself time by having to repeat the same code over and over again. You’ll also learn about Parameters, Arguments and how to use variables to complete tasks. Did this video help you? Leave a comment and let me know! I’m AlvinBLOX and I’ve been on Roblox for the past five years, creating games & teaching people how to script. By following my simple tutorials, you’ll have the tools to create your own Roblox game from scratch and begin to start attracting players to it.

Become a Channel Member for exclusive perks and to support me!

If you enjoyed this simple but effective tutorial, then leave a like. If you want to see some more videos and help to support the channel, then click the subscribe button.

Any questions or suggestions on videos that I should make? Leave a comment!

►SUBSCRIBE HERE:

► Get Social with AlvinBLOX:
Twitter:
Twitch:
Facebook:
Instagram: AlvinBloxYT
YouTube Channel:
ROBLOX Profile:
My Website:

#AlvinBLOX #HowToScriptOnRoblox #ClickMeForMoreTutorials

-~-~~-~~~-~~-~-
Learn how to use Filtering Enabled with this new tutorial: “Roblox Filtering Enabled Tutorial – Spawning Parts from GUI”

-~-~~-~~~-~~-~-
USE STAR CREATOR CODE “ALVINBLOX” WHEN BUYING R$ OR BC

BUY ROBUX ~
BUY BUILDERS CLUB ~

Nguồn: https://fivestarhotelsantalya.com/

Xem thêm bài viết khác: https://fivestarhotelsantalya.com/game/

34 COMMENTS

  1. after 3 years i watched this video. XD i made a script just check it out

    Baseplate = game.workspace.Baseplate
    Printing = "Its black bro"

    function myFunction(number1000,number2000)
    wait(7)
    Baseplate.BrickColor = BrickColor.new("Black")
    if Baseplate.BrickColor == BrickColor.Black() then
    print(Printing)
    end
    end

    myFunction(1000+2000)

  2. :flushed:
    function pissblock(number1,number2)

    wait(1)

    Instance.new("Part",game.Workspace)

    game.Workspace.Part.BrickColor = BrickColor.new("Br. yellowish green")

    if(5<6)then

    print(" N WORD MY CODE WORKED")

    end

    end

    pissblock(3,4)

  3. So i added both while loop command and functions command and the script goes like this

    while true do

    wait(1)

    function mutliply(number1,number2)

    print(number1*number2)

    end

    mutliply(6,6)

    wait(0.5)

    if 2+2==4 then

    else

    break

    end

    end

    It word without a mistake and all thanks to you! Got a new sub!

  4. I know that your video is a little bit old, but… I made this ;3
    function batatinha()

    print("I love you")

    end

    for i = 1,10,1 do

    if i > 4 then

    print(i)

    end

    wait(2)

    end

    print("i need to tell you something…")

    wait(3)

    batatinha()

  5. Well i made this, it does a tower of red bricks
    function myFunction()

    part = Instance.new("Part")

    part.BrickColor = BrickColor.new("Really red")

    part.Anchored = false

    part.Position = Vector3.new(0,10,0)

    part.Parent = game.Workspace

    end

    Wait(2)

    for i = 1,50,1 do

    myFunction()

    wait(.5)

    end

  6. function partTime(color1,color2)
    wait(1)
    part = Instance.new("Part",game.Workspace)
    wait(1)
    part.BrickColor = BrickColor.new(color1)
    wait(1)
    part.BrickColor = BrickColor.new(color2)
    wait(1)
    part.Size = Vector3.new(8,2,4)
    end

    for i = 1,3,2 do
    partTime("Electric blue","Institutional white")
    wait(1)
    end

  7. how do you get the 'end' bit. When I press end it doesnt appear. Am I suppose to press a certain button?

  8. mind if you help?

    id get how we get our numbers after our function ends
    function addition (number7,number8)

    print(number7 + number8)

    end

    addition(?)-i dont get?

  9. here's a little something i made

    function h(a,b)
    x = 1
    while x<1000 do
    wait(0.00001)
    part = Instance.new("Part")
    part.Parent = game.Workspace
    part.Position = Vector3.new(0,0,0)
    part.Size = Vector3.new(10,10,5)
    x= x+1
    if x<1000 then

    else
    break
    end
    end
    print (a+b)

    end
    h(1,5)

  10. function hotdog(sauce, bread)
    print("Please put in some sauce and bread")
    end
    hotdog(ketchup, hot dog bun)
    Does it work ?

  11. function Baseprint()

    game.Workspace.Baseplate.BrickColor = BrickColor.new("Really red")

    game.Workspace.Baseplate.Anchored = false

    game.Workspace.Baseplate.Transparency = 0.5

    end

    Baseprint()

    print("Script saved!")

    wait(3)

    game.Workspace.Baseplate.Transparency = 0

    game.Workspace.Baseplate.Position = Vector3.new("0, 162.4, 0")

  12. im gonna call mine MyFunction…(sensible)
    but you can call yours whatever you want…(also sensible)
    (casual)you can call it hamburger…
    ??????? WHY

  13. Here
    function ground()

    wait(1)

    ground = game.Workspace.Baseplate

    ground.BrickColor = BrickColor.new("Cyan")

    if (10<11) then

    print("This worked!")

    end

    end

    ground()

  14. At 2:31 shouldn't there be baseplate be after Workspace? Because it's suppose to be game.Workspace.Baseplate.BrickColor = BrickColor.new ("Really red") right?

  15. i have watched every video in this series and it really helped. im moving on onto the advanced scripting series 🙂

  16. function addition(number2,one)

    if 2+2==4 then

    print("This is Working")

    print (number2 + one)

    game.Workspace.Baseplate.BrickColor = BrickColor.new("Flint")

    else

    print("This does not work")

    end

    end

    addition(2,2)

  17. function copyrightednummbers(reallycoolnummber,thecoolestnummber)
    print(reallycoolnummber – thecoolestnummber)
    if (reallycoolnummber>thecoolestnummber)
    then
    print(the first nummber is cooler, cuz it's bigger DOOD)
    else
    print(the first nummber is not cooler, cuz it isn't bigger IDOT)
    end
    end

    copyrightnummbers(25,25.3)
    _________________________________________________________________________________

    THE OUTPUT

    -0.3
    the first nummber is not cooler, cuz it isn't bigger IDOT

  18. WOW dude great work!
    I tried to learn functions via Lua learning in roblox, and I couldn't understand the tutorial a guy made there!
    thank u so much! (+1 subscriber)

  19. I made this

    function hamburger()

    Instance.new("Part", game.Workspace)

    wait(1)

    game.Workspace.Part.BrickColor = BrickColor.new("Really red")

    end

    hamburger()

LEAVE A REPLY

Please enter your comment!
Please enter your name here