30 Seconds Scripting Roblox Studio: Variables & Functions

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 220

  • @TheRobloxCoach
    @TheRobloxCoach  Год назад +135

    Full vid: quizgrid.com
    ⬇️ P̶R̶E̶S̶S̶ T̶R̶A̶N̶S̶L̶A̶T̶E̶ T̶O̶ T̶U̶R̶N̶ O̶N̶ L̶I̶N̶K̶

    • @btricks2945
      @btricks2945 6 месяцев назад +2

      ​@AlexExtra-dw2qw You dont look like you have a job ngl

    • @dragon81001z
      @dragon81001z 6 месяцев назад

      what​@@btricks2945

    • @Mokhtar67
      @Mokhtar67 5 месяцев назад

      0:00

    • @Trmlcodeman
      @Trmlcodeman 28 дней назад

      On some it dont works😢

  • @InfernoXZ
    @InfernoXZ 6 месяцев назад +147

    Even though this video was made a year ago it really helped me, I found Functions confusing and this video perfectly explained it in a short amount of time! Your short videos are excellent and honestly are one of the most effective ways to learn Lua!

  • @gamingwithrealnader2901
    @gamingwithrealnader2901 Год назад +37

    I like this a ton even though I don't need the video because I already learned how to script along time ago I still see this as a really good scripting tutorial as for people that don't know how to script yet.

    • @GuardianTiger
      @GuardianTiger 5 месяцев назад

      Thats sweet, I'm a newbie for this but passionate for it.

    • @sly_9793
      @sly_9793 3 месяца назад

      Thats why i quit scripting ranked too many sweats (math.rad, math.deg, math.clamped, Unreliable events, secret())

    • @sly_9793
      @sly_9793 3 месяца назад

      Im learning camera shit rn

  • @CrookFedora
    @CrookFedora Год назад +38

    This is so entertaining 😂 keep it up

  • @IndieMzie
    @IndieMzie 4 месяца назад +7

    I’m glad I took all those web design and computer programming lessons now

  • @bijilerpe619
    @bijilerpe619 Год назад +254

    Thanks bro now i understood how to use function
    -Big brother that using his Lil bro account

    • @panned_noob
      @panned_noob Год назад +11

      i wonder if the little bro knows that he was using his account for this

    • @yosieflaweitt3238
      @yosieflaweitt3238 Год назад +6

      Stop the cap

    • @Lemonighter
      @Lemonighter 3 месяца назад

      ​@zeno3447what?

    • @LiteralBanishedArtist
      @LiteralBanishedArtist 2 месяца назад

      @@Lemonighter its like something that functions an objects child (as far as ik)

  • @Unmbra
    @Unmbra Месяц назад +2

    This was helpful. Now, I can finally add different music to different parts of my game.

    • @pestznyk
      @pestznyk 6 дней назад

      OH MY GOD YOURE RIGHT! TYSM FOR THE IDEA

  • @ubbezania5168
    @ubbezania5168 Год назад +4

    thx to you and creator docum i finally know the basic of scripting example:
    local base = game.workspace.baseplate(Local baseplate = script.parent)
    local function invisible()
    base.transperancy = 1
    end
    local function visible()
    base.transperancy = 0
    end
    while true do
    wait(5)
    visible()
    wait(5)
    invisible()
    end
    edit:thx again

    • @TheRobloxCoach
      @TheRobloxCoach  Год назад

      keep going lets goo!!

    • @Skilledpuffno10
      @Skilledpuffno10 Год назад +1

      Nice One Go you can do it become a professional Lua Scripter!!
      (I am still learning the basics)

    • @hetnianaba
      @hetnianaba Год назад

      mine is better
      local touchedPlayers = {}
      game.Workspace.Part.Touched:Connect(function(hit)
      local plr = game.Player:GetPlayerFromCharacter(hit.Parent)
      if plr == nil then return; end
      if touchedPlayers[plr.Name] == true then return; end
      plr.Character.Humanoid.Speed = plr.Character.Humanoid.Speed*4.5
      touchedPlayers[plr.Name] = true
      end)

    • @chiseledcheese
      @chiseledcheese Месяц назад

      @@hetnianabathis is equally bad 🥶

  • @thefarmer283
    @thefarmer283 2 года назад +14

    These lessons are very epik keep it up

    • @TheRobloxCoach
      @TheRobloxCoach  2 года назад +2

      Glad you like them!

    • @chiseledcheese
      @chiseledcheese Месяц назад

      ngl RUclips shorts is the last place you should be learning to code at

  • @MrSanfrinsisco
    @MrSanfrinsisco 3 месяца назад +1

    This is a great tutorial on inheritance, I remade work at a pizza place with this, thank you 🙏

  • @sca1632
    @sca1632 Год назад +1

    This is a good video and I love roblox and roblox studio. I create many game, and I wrote script this is a amazing feel.

    • @chiseledcheese
      @chiseledcheese Месяц назад

      don’t learn from RUclips shorts 🥶🥶

  • @Rouk-zk
    @Rouk-zk 8 месяцев назад

    Idk but most of the tutorials out there well just tell you the basics of lua and let you go
    BUT THIS ... NAH ITS MASTERPIECE

  • @LazySine69
    @LazySine69 Год назад +18

    Tysm! Now i finally understand how to use events ☠ ☠

  • @jaysonjdbeck6574
    @jaysonjdbeck6574 3 месяца назад

    You are so cool man, may God bless you all

  • @Batboyjoe100
    @Batboyjoe100 5 месяцев назад

    Actually very helpful thank you

  • @rustlostlol9138
    @rustlostlol9138 Год назад

    cool. now i can easily do flashlight back easingstyle tween. thanks!

  • @Elect000
    @Elect000 Год назад +1

    you make so much sense

  • @OzkanOzgur-g1m
    @OzkanOzgur-g1m 2 месяца назад

    This looks so Funnn

  • @Jorizz69
    @Jorizz69 2 месяца назад

    Thank you so much now I know how to script

  • @frhf_gd
    @frhf_gd 3 месяца назад +1

    Scipt parented to the Baseplate hurt me

  • @Baditow
    @Baditow Месяц назад

    this video when it'll probably confuse the person watching it rather than teach them

  • @Greatence
    @Greatence 6 месяцев назад +5

    the parent got touched??!

    • @minaam31
      @minaam31 4 месяца назад +1

      Nega watt 💀😭

  • @alexendarke
    @alexendarke Год назад +3

    You might as well just do ‘local printMessage = print’ to turn the variable into the print function lol

    • @schnegger
      @schnegger Год назад +1

      Local baseplate = script.Parent
      baseplate.Touched:connect(function()
      Print" I like BBC"
      end

  • @jafizz6505
    @jafizz6505 Год назад +23

    Bro could of just said print(“I like pizza”)

    • @jafizz6505
      @jafizz6505 Год назад +2

      Nevermind I just saw .touched

    • @SkuppyGamez
      @SkuppyGamez Год назад +1

      could of done function printMessage(message) and printMessage("I like pizza")

    • @Narvalo_Lastar
      @Narvalo_Lastar Год назад

      ​@@SkuppyGamezwith print(message) in the fonction*

    • @allthemallows
      @allthemallows 11 месяцев назад

      @@SkuppyGamezmessage is a variable so u need that

    • @SkuppyGamez
      @SkuppyGamez 11 месяцев назад

      @@allthemallows the "Message" variable is declared when the function is called, so there is no reason for it to be outside of the function

  • @zikisieda
    @zikisieda Год назад

    thank you, very helpful!

  • @General_Solid
    @General_Solid 2 месяца назад

    I’m learning JavaScript aka Minecraft script. And this looks way easier than JavaScript. I actually understand it a bit.

  • @anotherdeadchannel
    @anotherdeadchannel Год назад +2

    You should've also showed anonymous functions bc idk why u need a different video for the same topic

  • @vrfrenzy8451
    @vrfrenzy8451 Год назад +1

    people got so low attention spans now they got to watch 30 second tutorials that usually last a few mins. Good tutorial tho

  • @deletəd
    @deletəd 2 месяца назад +1

    Is roblox[] just Python? Bc I have a Python book that might be helpful for future use.

  • @technogamer1044
    @technogamer1044 2 месяца назад

    "Script.Parent.Touched"💀

    • @LiteralBanishedArtist
      @LiteralBanishedArtist 2 месяца назад

      bro thats the script fym

    • @polyaro2504
      @polyaro2504 Месяц назад

      @@LiteralBanishedArtistyou can also do script.parent.parent.touched

  • @Pu_9393
    @Pu_9393 2 месяца назад +1

    Local message = "i like pizza"

  • @DavidL-t3t
    @DavidL-t3t Год назад

    Thanks for your help

  • @forty.editss
    @forty.editss 2 месяца назад

    I get it that all you are starters, in about 3 years or so you’ll learn LuaU perfecrly

  • @Splays11
    @Splays11 Год назад +1

    Spends so much time explaining.

  • @youssefahmed1379
    @youssefahmed1379 6 месяцев назад +2

    Can you explain what is local and what is function

    • @sonic176yt7
      @sonic176yt7 6 месяцев назад

      Local means only you can see it and function is a short piece of code that can be called with script.Parent.(event).Connect:"function"()

    • @youssefahmed1379
      @youssefahmed1379 5 месяцев назад +1

      ​@@sonic176yt7thanks

  • @Gray_mk
    @Gray_mk 9 месяцев назад

    local message = "I like pizza"
    local part = script.Parent
    part.touched:connect(function()
    print(message)
    end)

  • @SigmaBananaProGamer45
    @SigmaBananaProGamer45 Год назад +1

    this isnt really teaching how to script, this is just telling you what to type

  • @PANDOCHIPISREAL
    @PANDOCHIPISREAL Месяц назад

    -your helpful❤-

  • @RocketEditz1
    @RocketEditz1 5 месяцев назад +6

    Roblox scripting in 30 seconds.. meanwhile length of video: 59 seconds 💀

  • @BonPonJon
    @BonPonJon 3 месяца назад

    it will still print even if you didn't touch it, you should also add a line of code that will only work if the player touches it

    • @ascz.
      @ascz. 3 месяца назад

      Mhm correct.

  • @Sird3viXx
    @Sird3viXx 2 месяца назад +1

    Dont forget to add a wait() after the script.parent thing or else it will crash studios

  • @awoooga5857
    @awoooga5857 4 месяца назад

    Got a question. Doesn't the local message variable have to be in the scope of the function?

  • @explosion_z28
    @explosion_z28 16 часов назад

    bro why do all my favorite youtubers never
    blow their nose or unclog it 😭😭

  • @UnLuckyStudioRoblox
    @UnLuckyStudioRoblox Год назад +3

    Are you able to make functions in module tables? Id like to make my UI scripts much cleaner using module scripts and tables if possible.

    • @gd-xk4rr
      @gd-xk4rr Год назад

      lets say u have a table
      local mt = {} -- My table
      -- Now if we wants to make a function to that now we can assign functions to that table
      function mt:myFunction() end
      -- or
      function mt.new() end -- constructor if u know what that means.
      -- 2 ways to link functions to tables
      Is this what u asked for?

    • @gd-xk4rr
      @gd-xk4rr Год назад

      also if u wanted to make a UI Library for UI then make sure to return the table like a module script
      local mt = {}
      return mt -- end of script

  • @WINCHERTANWEIZHEMoe
    @WINCHERTANWEIZHEMoe Год назад

    It probably help me to learn script

  • @Itsgalaxy574
    @Itsgalaxy574 2 месяца назад

    Excuse me coach, how do I make this: .=. I’m trying to make a game but I can find the right Dot/. That’s between the equal signs

  • @Chiramino
    @Chiramino 3 месяца назад

    Is it weird how I understood this more than a 20 min vid?….

  • @Molilo_
    @Molilo_ 2 месяца назад

    I'm a little confused by the "local" part, like what does it do ? And when do we need to use it ?

  • @yamasalehzada12345
    @yamasalehzada12345 Месяц назад

    local message = "i like pizza"
    function printMessage()
    print(message)
    end
    script.Parent.Touched:Connect(printMessage)

  • @erickoavenada969
    @erickoavenada969 Год назад

    Do you have a long Videos

  • @DesertDingle
    @DesertDingle Год назад

    But is it really even lua if you don’t spam local before everything? Global namespace is overrated tbh

  • @xbmc1917
    @xbmc1917 2 месяца назад

    Thank❤

  • @gd-xk4rr
    @gd-xk4rr Год назад +1

    Why would you want to use a function to print something tho i mean just use the default print function you are provided and you did not even show how to use parameters.

    • @toadletheoneandonly
      @toadletheoneandonly Год назад

      hes explaining variables and functions hes not aiming to make it the most realistic script

  • @soonist123
    @soonist123 2 месяца назад

    What is Parent and Children, im confused also what is Connect

  • @janehazelbanogon1259
    @janehazelbanogon1259 Год назад

    ❤❤wow

  • @Bludimi
    @Bludimi 2 месяца назад

    First part is understanding it
    Second part is
    How do you actually use it?

  • @TortTornino
    @TortTornino 8 месяцев назад

    Thanks!

  • @gamingbox3
    @gamingbox3 5 месяцев назад +2

    i dont understand at all what the names do 😭

    • @kashmirandal6282
      @kashmirandal6282 4 месяца назад

      You can choose them. For example:
      local Hello = 13
      if Hello == 13 then
      print("It is thirteen")
      else
      print("It is any number but thirteen")
      In this scenario, you choose to make Hello be equal to 13. It could be bananas, apples, gold bars, etc.

  • @AzureAzureAzureAzure
    @AzureAzureAzureAzure Год назад

    How do I make the script check for a value constantly like I have a folder in startercharacter scripts and I want a loca script to always be checking for a value that is on inside of that folder

    • @tempura8390
      @tempura8390 10 месяцев назад

      Get a reference to that value

  • @Skillverfish_
    @Skillverfish_ 2 месяца назад

    Woah

  • @RonyVilager_Wierd
    @RonyVilager_Wierd 7 месяцев назад

    Thank You

  • @hetnianaba
    @hetnianaba Год назад +1

    Bro could have used a anonymous function

  • @Vexy803
    @Vexy803 9 дней назад

    Hi coach i was tryna see if u can help me make a racing game

  • @JustinTrill
    @JustinTrill 3 месяца назад

    Why are we putting a script under a part?

    • @dimxx987
      @dimxx987 3 месяца назад

      Cause .Touched event is for parts.

    • @JustinTrill
      @JustinTrill 3 месяца назад

      @@dimxx987 no idiot, we should be having server scripts under server script service that handles workspace part manipulation. We shouldn’t get into the habit of putting scripts under parts.

  • @xNoobHunterx
    @xNoobHunterx Месяц назад

    quotations!!! YOU MISSED THE QUOTATIONS!!!!!!

  • @PixelChrisDev
    @PixelChrisDev Год назад +1

    how do you zoom in the script ?

  • @Wallhammer
    @Wallhammer 9 месяцев назад

    Yo bro i opened roblox stusio and the screen wasnt inside the toolbox thing and i had to resize it inside and whenever i try clicking enter it just selects all
    Edit:plus if i make a new script the print doesnt show up and when i click the minus button the print is outside

  • @Andibarigaming
    @Andibarigaming 5 месяцев назад

    How to climb a wall:
    Just climb it
    How to script:
    Parent.local.scriot.wall.baseplate.fuction.print
    Just learn to script

  • @speed.clips5
    @speed.clips5 11 месяцев назад

    could've just done script.parent.Touched:connect(function()
    print("I like pizza")
    end)

    • @tempura8390
      @tempura8390 10 месяцев назад

      If you are using the function outside the event, Is better for it to have its own definition. For example, you reload a gun not only by pressing 'R', but also by emptying your mag, so two different situations where the function Will be calles.

  • @Wardfayyad
    @Wardfayyad 4 месяца назад

    is this a local script or just a script?

  • @Fartheadidioy7
    @Fartheadidioy7 Год назад

    what do u even use function for?

  • @fusionmedia08
    @fusionmedia08 Год назад

    well whats the point of printing the message.. what will it do in a roblox game? and strings are pointless too. it does nothing but give output

    • @greenja4688
      @greenja4688 Год назад

      its only for understanding

    • @itsnotloveitslust
      @itsnotloveitslust Год назад

      Printing is used for debugging/testing mainly. Say for example something isn't working in your code, but youre not entirely sure where? Well, thats where printing can come in handy, because itll tell you in the output once it reaches the line with the print in it. So for example, if you have an if statement with some code in it, and its not running, you could put a print at the start of your if statement to check if your script is actually reading that if statement, and if the condition of the statement is true. If for whatever reason, it doesnt print to the output, then boom, you just discovered part of your problem.
      As for strings, they are also not pointless. A lot of things on Roblox require text(AKA a string). Need to rename something like a part for example? Use a string.

    • @breaddacat7935
      @breaddacat7935 Год назад

      printing is used for finding errors and strings are used for stuff like links, player name, getting service, wait/find child, etc

    • @tempura8390
      @tempura8390 10 месяцев назад

      You use print a lot, not for the players, but for you as a dev, It helps checking errors, It helps checking wether the Code stops in some place, It helps to check if the outputs are valid.
      And Strings are SUPER important, anything you see as text in any place, Is a String, even numbers, as their binary format can't be just simply shown.

  • @buckethead6755
    @buckethead6755 Год назад +1

    When I use function it say I need to use end

    • @walteresqu
      @walteresqu Год назад +1

      The "end" closes the function so it doesn’t collide with the code that can be below it.

  • @fsdfffewefw
    @fsdfffewefw Год назад

    why dont yall use "local function blahblah()
    "

  • @ToatsNotAnNPC
    @ToatsNotAnNPC Месяц назад

    Still didn’t work for me 💀

  • @Humor_Pa_Kufi
    @Humor_Pa_Kufi Год назад

    hey how to do more than 2 rows in roblox studio pls reply I need it fast😢

  • @McSkripters
    @McSkripters 10 месяцев назад

    what is the sound track?

  • @dsadsaasddasasdadsfqafawf
    @dsadsaasddasasdadsfqafawf 4 месяца назад

    bro said "30 secs" but it was 58 secs🤣🤣🤣🤣

  • @majd_TY
    @majd_TY 9 дней назад

    for people is finding in Comments:
    Localed script credit
    Copy give majdbebo:
    Scripting youtuber:
    Script:
    local message = "i like pizza"
    function printmessage()
    print(message)
    end
    script.Parent.Touched(printmessage)

  • @rare4lyfe
    @rare4lyfe 4 месяца назад

    how do i get up the script part to type

  • @BnzDvz
    @BnzDvz 6 месяцев назад

    Is function like def in python?

  • @vaishantsingh6thc500
    @vaishantsingh6thc500 Месяц назад

    Is this python or Lua

  • @vincedamato8563
    @vincedamato8563 Год назад

    But what’s the point of a variable ?

    • @greenja4688
      @greenja4688 Год назад

      suppose ur building a shooting game. you made a gun. the speed of the gun shooting is 2 second. u enter that in a variable and use the variable in many other places of the script.

    • @tempura8390
      @tempura8390 10 месяцев назад

      Stores data in an accesible way. Let's say you have a value object in script.parent.folder1.folder2.module.value, you can store that reference into a variable, and then, you can access that data from your variable.

  • @IsaacRobotic
    @IsaacRobotic Год назад

    baseplate doesn't shop up for me do you now why

  • @Verblox
    @Verblox Год назад

    fire logo made in canva maybe? me tooo mannn

  • @micahfoote
    @micahfoote Год назад +1

    This makes no sense

  • @NatureEditzzz
    @NatureEditzzz Год назад

    OMG! I HAVE BEEN TRYING TO LERN CODE FOREVER AND I WAS EXPERMENTING AND I JUST MADE A DEATHBLOCK! BY MYSELF WITH NO TUTS!!!!!!!!!!!!!!!

  • @OurInception24
    @OurInception24 4 дня назад

    is it actually that easy?

  • @Nostic525
    @Nostic525 Год назад

    What does local stand for ?

    • @tempura8390
      @tempura8390 10 месяцев назад

      Variable declaration only exists for that scope and lower levels. There's the global scope, when you create a function, the function Is part of the global scope, all variables you create inside that function are part of the function scope. Not using 'local' forces the variable to be global scope, which Is not always the case, so in short, always use 'local' just to be sure.

  • @el_tura
    @el_tura Год назад +2

    ok now im know how print work

    • @nexttimebud
      @nexttimebud Год назад

      print is a basic one even I learned it in 1 day without any tuts when I was a starter

    • @foxiwq
      @foxiwq Год назад

      BRO WHY DID U LEARNED IN 1 DAY ITS SO EASY

    • @el_tura
      @el_tura Год назад

      @@foxiwq its hard

    • @justogar8136
      @justogar8136 Год назад

      @@el_turajust think of it simply

    • @justogar8136
      @justogar8136 Год назад

      @@el_turafor instance to print a variable you could do
      local variable = “Hello World”
      local variable2 = “, yes”
      while true do
      wait(1)
      print “(variable)..(variable2)” I think this is lua syntax I use c++ or c# tho
      This would print Hello World, yes

  • @GGA098
    @GGA098 3 месяца назад

    i wanna know how to run it tho :C

  • @Renderthetender
    @Renderthetender 2 месяца назад

    Ima put boo instead of i like pizza >:)

  • @whoishype
    @whoishype 3 месяца назад

    I JUST ATE PIZZA-

  • @GoofyEntity
    @GoofyEntity 14 дней назад

    this us hella confusing my brain isnt braining

  • @Funwithsurroundings
    @Funwithsurroundings 29 дней назад

    I don't understand

  • @djiexn
    @djiexn Год назад

    This is roblix scripting in 30seconds hard core😅

  • @FranklinAntwi-zu5ot
    @FranklinAntwi-zu5ot Месяц назад

    Who wanna team up with me and make a game

  • @Mc.ZhongliRealGeoArchon
    @Mc.ZhongliRealGeoArchon Месяц назад

    All i know is no.parent🗿

  • @1000-THR
    @1000-THR 5 месяцев назад

    woa

  • @aldrincecilio41
    @aldrincecilio41 5 дней назад

    my brain: 🧐🧐