What are Local Scripts? Roblox Scripting Explained

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

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

  • @GnomeCode
    @GnomeCode  3 года назад +76

    Tomorrow: Module Scripts

    • @PineBloxx
      @PineBloxx 3 года назад +4

      👍👍

    • @dunderdyle
      @dunderdyle 3 года назад +4

      Can you be my friend :)

    • @oSpam
      @oSpam 3 года назад +2

      Yess

    • @Ynoob87
      @Ynoob87 3 года назад +1

      Nice

    • @bloxer_7696
      @bloxer_7696 3 года назад +4

      @@dunderdyle join his discrord I’ve talked to him alot I sent him a emoji suggestion once

  • @PineBloxx
    @PineBloxx 3 года назад +17

    Thanks Gnome! This really boosted my knowledge with local scripts! Excited for the module scripts!

  • @peppyweppy6851
    @peppyweppy6851 2 года назад +9

    Thank you so much Gnome! I was really confused about what localscripts did before, but this video makes it so clear!

  • @Enes_emre01
    @Enes_emre01 Год назад +21

    Video summed up:
    -Local script are mostly used for gui
    -local scripts can only be used in some folders/services
    -a local script only fires an event to a device, meaning if I were to click on a button, only my game(my device) would be changed, everyone else wouldn't be affected

    • @Shadow-tu7yb
      @Shadow-tu7yb Год назад +1

      So basically local scripts are just for the player while global scripts are for everything

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

      yeah@@Shadow-tu7yb

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

      @@Shadow-tu7yb Also, LocalScripts are actually Client-Sided scripts, that means that their actions are also instantaneous and don't depend on your ping/ms.

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

    Thank you for helping me understand local scripts. Sometimes when I watch RUclips tutorials, I am just confused why they use local scripts instead of basic scripts.

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

    I am a dude from 2024, and yet these tutorials are the best I could find

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

    6:52 the moment you simply put "workspace" as the beggining I understood what was I doing wrong.
    my dumbass was trying to find an item from the workspace starting at script.Parent (the local script is in StarterGui)

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

    You just made me learn 10x more about local scripts.

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

    This was actually really useful, and I can see a lot of ways I could use this!

  • @xsticcyds5459
    @xsticcyds5459 3 года назад +5

    Even though I know everything he says I still like to watch it.

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

    This was useful, I've spent hours trying to figure out how to make a local script in a tool work for multiple players, but only the first player can use the tool. maybe this video will help me solve this.

  • @SeiboRoblox
    @SeiboRoblox 2 года назад +1

    OMG HELPED ME ALOT, I DIDNT KNOW THE DIFFERENCE BEFORE

  • @eltiziocatoagagag3215
    @eltiziocatoagagag3215 2 года назад +1

    I was trying to find a tutorial for another thing but i couldn't find it, so I tried searching actually how scripts works and thanks, now i have understanded how this works

  • @noreally2120
    @noreally2120 9 месяцев назад +6

    I did it exactly as he did in the video and keep getting:
    Entrance is not a valid member of workspace “Workspace”

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

      Try to see the name of the part

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

      WaitForChild("Entrance")

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

      I think that ur Part name is not Entrance.

  • @alskopim
    @alskopim 2 года назад

    After a year of trying to script on roblox, I find this guy, who explains it in 9 mins compared to another yt video which took 40 and explained it badly

    • @ps92809
      @ps92809 2 года назад

      how did someone take 40 minutes to explain what a local script is

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

      @@ps92809 fr

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

    this guy deserves like 99999 subscribers, lol. his videos are so easy to understand, yet so complex.

    • @jellybeann69420
      @jellybeann69420 2 года назад +1

      Nah, he deserves.. 999999999999999999999999 subs..

    • @albertoedgar831
      @albertoedgar831 2 года назад

      @@baconhairawesomeyeah7528 nah he deserves this:
      local gnomecodesDeservedSubs = math.huge()
      while true do
      gnomecodesDeservedSubs += gnomecodesDeservedSubs * math.huge()
      end

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

      He’s pretty damn close to that goal

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

    1 year later still a awesome video

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

    thank you i could not have my code work for 4 days until now

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

    I do the exact same as you but get: Entrance is not a valid member of Workspace "Workspace"

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

    Omg thank you so much my local script wasn’t running and I wasn’t sure why

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

    everyone can relate to the changing robux through inspect element 😅

  • @retrostudiogameplay2581
    @retrostudiogameplay2581 3 года назад +2

    Hi, when will you be resuming the Mafia City series? Thanks!

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

    thanks allot. im learning roblox studio and you explained this so well

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

    Wow thanks man you make things so clear you should have much more subscribers

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

      Glad I could help!

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

      @@GnomeCode Why learn to script when you can use Stolen Roblox games

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

      @@mrblackblack2802because it’s fun and no one plays stolen games other then ogaboaga

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

    ty bro you have the best tutorials. also sometimes you sound like hoxton from payday 2

  • @MagAgent006-qj5nm
    @MagAgent006-qj5nm Год назад

    OMG THANK YOU SO MUCH THIS IS WHAT I WANT FOR MY GAME!!!!!!!!
    BRO IF U DIDNT UPLOAD THIS I WILL CANT MAKE GAME FOREVER

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

    you're amazing in explaining stuff

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

    This helped me a ton ty!!!(I instantly subbed)

  • @Xecutioner62
    @Xecutioner62 9 месяцев назад +1

    This works but the wall just fallows you!!! How to fix

  • @detoux8716
    @detoux8716 4 месяца назад +2

    do u have to publish the game for the local script to work?

  • @A.F.A_REDACTED
    @A.F.A_REDACTED Год назад

    Why you have Only 80k subs? You help so much

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

    Thank you so much, you gained a subscriber!

  • @InsanePasta64
    @InsanePasta64 8 месяцев назад +2

    How come my studio is calling the name “invalid” I need help on how to fix it

    • @alexis16543
      @alexis16543 7 месяцев назад +2

      do a wait(3) before it because the script runs before the part even spawns in

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

    Life saver, my local script wouldn't work cus its in a workspace part, now ik why

  • @mauigg8282
    @mauigg8282 3 года назад +1

    Soo helpful thank you so much, keep up the great videos :D!!!

  • @that1gamerlad98
    @that1gamerlad98 3 года назад +1

    Very Cool! I might actually have learned something from this.

  • @datboin4te
    @datboin4te 2 года назад +1

    Ik it might be a lot but can you make a video talking about what words mean like humanoid or stuff like that and explain so stuff like that

  • @HowlerNic
    @HowlerNic 2 года назад +1

    had me gone when he put 9 billion robux on his account

  • @CATSAMMEL
    @CATSAMMEL 3 года назад +1

    Local Scripts: only one player can (see) (something happends)

  • @WearWQLF
    @WearWQLF 3 года назад +1

    finaly a video thanks gnome code im also number 1st in video yeah

    • @GnomeCode
      @GnomeCode  3 года назад

      ruclips.net/video/PfYnvDL0Qcw/видео.html

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

    Your explain is indeed make clear my stupid brain, thanks a lot!

  • @playerje4722
    @playerje4722 2 года назад

    Thanx, I finaly understood the diference

  • @sevenstarrryy
    @sevenstarrryy 2 года назад

    Random fact about my laptop: my sister stepped on it one time and it created black spots/blind spots

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

    Why do it keep coming back after I delete it?

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

    It's not working. Did exactly as in the video and it says Error Entrance is not a valid member of Workspace "Workspace" - Client - LocalScript:1
    EDIT: Had to put local Part = game.Workspace:WaitForChild("Entrance") first for some reason.

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

      i had the exact same issue. i think this is because script loads in before the part, and the "WaitForChild" thing gives the part time to do so.

    • @chrismangold812
      @chrismangold812 10 месяцев назад +1

      yeah script runs b4 part loads in, you can also put like wait(3) on the local script before you run the code

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

      thank you@@chrismangold812

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

      or you can use :WaitForChild(OBJECT)

  • @SolarDUSK
    @SolarDUSK 2 года назад +1

    I need some help with local scripts... why when I turn something visible with a local script, it's invisible on other people's screen?

    • @fartedgamer32
      @fartedgamer32 2 года назад +3

      because the local script only works for the client its operating on. if you want everyone to see it visible the use a server script (regular script)

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

    so basically local scripts are how you make stuff client side..?

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

    someone please help, i’m doing the same thing it’s just with sounds and a tween, with touched events. it won’t work. please help
    fixed

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

    Amazing vid!

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

    I followed this example and when I ran this project, entrance should disappear, but in console it says: "Entrance is not a valid member of Workspace "Workspace"", what do I do then?

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

      i have the same issue

  • @Sckee_Real
    @Sckee_Real 3 года назад +1

    Gnome code, can you help me make a game, when I try it doesn’t work.

  • @lemonN3rd
    @lemonN3rd 3 года назад

    I’m only 3 months into coding and I made a elevator and now that I know what local scripts are I can make a invisible potion

    • @tekgewet
      @tekgewet 2 года назад

      Kewl, too lazy to start but once I try and get my life together I’ll start

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

    so it doesnt work cause my device is too bad??? or just because i test it in studio and studio is maybe weaker idk

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

    local means only for the player that press or did something global or server script is global for whole server

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

    thanks this video was really helpful

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

    Very well explained thanks

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

    local script is ender chest and normal is chest and module is trapped chest ?

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

    Can u make a full advanced scrioting tutorial playlist

  • @FSHY.
    @FSHY. 3 года назад +1

    Module script next?

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

    ty it was so easy to understand

  • @CHRF-55457
    @CHRF-55457 2 года назад

    Is there a way to change a local script into a server cript? Going to the dev forums helped me fix one problem but couldn't help me fix the other 5, maybe six left.
    Things I've fixed:
    Arm welds showing up.
    Things to fix:
    Bayonet attack animation
    Bayonet equipping animation
    Shoot to kill players.
    Reloading animations
    Holster Idle animation
    (There might be some stuff i forgot to mention)
    Trying to fix a free model gun i found so it can be use for pvp. Every one of it's scripts were local scripts til i found it

  • @fmnzo
    @fmnzo 2 года назад

    thank you for this it really helped me

  • @GarethMcD-zq8ei
    @GarethMcD-zq8ei Год назад

    well this tells me so much, right so I know the local script only works in few places but what about said parts that are connected to the script, how do I tell the script that's where there part is that you need? More context I got this VPframe script that makes a "live camera feed", the problem is the way I want to use it I need one of the parts to not be in the workspace but I genuinely have no clue how to set it within the script that's where the part is, other words there is two parts, camera & screen I need the screen to be in a specific model/folder for it to give me the desired results but I can't find my answer anywhere (if there even is one), simply if there is an answer well, I just don't know what else to search ;-; I've been at this for like three days now & keep getting set back each time I think I've learnt something (sad truth I haven't)

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

    the heck that so useful!

  • @grannygamersoomets1632
    @grannygamersoomets1632 2 года назад

    Hey bro thank you so much tho it really helped me out now i know how to make localscript door

  • @RZzOo
    @RZzOo 2 года назад +1

    Thanks for that bro

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

    wait so if i wanted to only have the color of a part change only for that person i would use a local script?

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

    Yo do they save if you leave or something

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

    this video was very helpful! thanks for teaching the logic behind scriptings!!!

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

    BRUH ITS DONT WORK FOR ME

  • @selevis7563
    @selevis7563 2 года назад

    I just starrted and I wanna learn what everything mean and what everything does

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

    Tysm! New sub goes to you!

  • @pheo1299
    @pheo1299 2 года назад

    Okay, no one has ever answered me on youtube rather than redit or devforum. But how do I make only one client to see what the current client is doing? Like if i touch the part it turns invisible but only for me? i did that but it didnt happen

    • @rucals
      @rucals 2 года назад

      use local sript instead of script

  • @7vik147
    @7vik147 Год назад

    thanks gramps

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

    Pleasseeee i need help, so my problem is how to have a LocalPlayer but have this only on a script and not a LocalScript?? PLEASE HELPP

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

      You cant get a local player from a server side script you can only get them for local scripts, there are multiple ways to get a player like from a local script but it depends on where your script is. I hope i could help out if you have any questions tell me

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

      You can try this but due to me not knowing where and what the script is this might not work local player = game.Players:GetPlayerFromCharacter(script.Parent)

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

      Could also try this for _,Player in pairs(game.Players:GetPlayers()) do
      end

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

      Or using game.Players.PlayerAdded:Connect(function(plr)
      end)

  • @waka9115
    @waka9115 2 года назад

    Thanks man!!!

  • @Mazen-og9bh
    @Mazen-og9bh Год назад

    omg thank you so much

  • @Justice1Night
    @Justice1Night 2 года назад

    Do anyone know how do we save a script?

  • @The_NoobDeveloper
    @The_NoobDeveloper 3 года назад

    Cool now ik what the difference is

  • @НастяФедорова-ь8ь
    @НастяФедорова-ь8ь 3 года назад

    Hey, Gnome, could you do review of Teddy project in Studio?

    • @cliffcoastcafe
      @cliffcoastcafe 3 года назад

      You mean his game or a fan game you made if its his game, i might be able to help as i spended way to long studieng it

    • @НастяФедорова-ь8ь
      @НастяФедорова-ь8ь 3 года назад

      @@cliffcoastcafe I mean that I opened Teddy in studio and saw a bunch of scripts that wasn't explained in tutorial series. So I want to know what they do etc.

    • @НастяФедорова-ь8ь
      @НастяФедорова-ь8ь 3 года назад

      I also want to know how much did he do from Premium Payouts, buuuut I believe, that he will not tell me........

    • @cliffcoastcafe
      @cliffcoastcafe 3 года назад

      @@НастяФедорова-ь8ь he quited his series to make it a public game and made speed builds of the maps. Also the series was never intended to be a tutorial

    • @НастяФедорова-ь8ь
      @НастяФедорова-ь8ь 3 года назад

      @@cliffcoastcafe maybe I am not alone in my wish to see a project's review and if so, maybe he will do it.

  • @alco8225
    @alco8225 2 года назад

    thank you very much

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

    I'm only Roblox developers don't know meaning of function

  • @tuzsonYI
    @tuzsonYI 3 года назад +1

    Can you make an NPC who can walk using MoveTo() command?

    • @nah1247
      @nah1247 3 года назад

      Yes u can do NPC.Humanoid:MoveTo(Vector3 position here)

    • @tuzsonYI
      @tuzsonYI 3 года назад

      @@nah1247 i know but they cant move just staying i needed use a free model to can use move to. Like im making a new game idea from: 12 minutes. And i need a cool costum NPC who can walk

    • @nah1247
      @nah1247 3 года назад

      @@tuzsonYI then ur prob doing it wrong, ur new to scripting?

    • @tuzsonYI
      @tuzsonYI 3 года назад

      @@nah1247 no, if i use the Rig builder its not works to MoveTo try it

  • @coolpyxl
    @coolpyxl 2 года назад

    Me before at scripting: 💀 me now after watching 😎

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

    I was thinking mabe someone here can answer: How can i make items belong to someone?
    Ex. If I want to make, lets say, a rideable horse in my game, but only the person that has that horse can ride It.
    Also there would be multiple horses belonging to different players
    AND of course, I want the horse to be visible for others too

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

    WHAT?? WHY DOESN'T IT WORK IN MY GAME???!!!?

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

      It’s not working for me either

  • @jackinthebeanstalk-mw5bg
    @jackinthebeanstalk-mw5bg Год назад

    thank

  • @oreoplays7887
    @oreoplays7887 3 года назад

    You should do squid game that would get lots of veiws

  • @exotic1405
    @exotic1405 3 года назад

    Nice

  • @josephsqwad1-animation847
    @josephsqwad1-animation847 Год назад

    funni hack that was so entertaining

  • @kr4sk
    @kr4sk 3 года назад

    epic epic

  • @alek9194
    @alek9194 3 года назад

    cool

  • @pezz9112
    @pezz9112 2 года назад

    1:55
    0.01 robux nice

  • @oxhah
    @oxhah 3 года назад

    Early

  • @addanbillis
    @addanbillis 3 года назад

    Hi

  • @legotrex
    @legotrex 3 года назад

    Local scripts are spooky :0

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

      A blue paper with a person looks scary to you?

  • @HeroRayOfficial
    @HeroRayOfficial 3 года назад

    First

  • @GabblingGary
    @GabblingGary 3 года назад

    :)

  • @davidguo9923
    @davidguo9923 2 года назад

    O

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

    Love your vids!🎉