Тёмный

What are Local and Server Scripts? - Roblox Scripting Tutorial 

GnomeCode
Подписаться 113 тыс.
Просмотров 37 тыс.
50% 1

As usual, any questions - let me know down in the comments below (or join the discord server and ask me there!)
DISCORD
Please check out my discord server 'Gnomeland'
/ discord
MUSIC
"Bit Quest"
Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
creativecommons...

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 124   
@Banana-ui3kj
@Banana-ui3kj 4 года назад
Server scripts: Shows on everyone’s screen, delete a part, the whole server sees the block deleted Local script: Only u can see at, delete a block, only u see the block get deleted everyone else still has it and can see it
@corbinpizz8702
@corbinpizz8702 4 года назад
Thank you i had a hard time understanding the video
@kevindevon7649
@kevindevon7649 4 года назад
this was more helpful lmao
@ysuysu3364
@ysuysu3364 4 года назад
How do i make a local script visible to other players?
@garysarchivechannel7050
@garysarchivechannel7050 3 года назад
what about for guis, i want to make player1 show " You Win! " and player2 " You lost. " caus im making a tower defense game
@owo7789
@owo7789 3 года назад
Thank you
@totalnubs1148
@totalnubs1148 2 года назад
although this vid is 2 years old and he will probably never see this, I just need to say. You are amazing, the amount of effort you put into each of these tutorials are incomparable to 99% of the other roblox tutorials out there. Thank you so much u amazing gnome man. i’m rooting for u in ur battle against alvinblox
@GnomeCode
@GnomeCode 2 года назад
Old video indeed, thank you for the kind words I really appreciate it!
@moongus6247
@moongus6247 4 года назад
thankyou so much for a while i have been trying to figure out how to make a sound only play for one person the problem was my local script was in workspace:D
@anrovlogs2834
@anrovlogs2834 5 лет назад
I watched ur all video sir
@botnumb39
@botnumb39 2 года назад
That was harsh lol
@deathmeter7243
@deathmeter7243 Год назад
@@Jcisnice u care enough to reply.
@smoothrequiem5374
@smoothrequiem5374 4 года назад
inside a nutshell, Server: Server scripts show to everyone when you run a script, for example, if you ran grab knife. since grab knife v4 is a FD, you would have to require it. (Which I did). When you require a script you turn it to Server or loadstrings are the same. FD scripts dont work now, but all other scripts that are server scripts, show to everyone. Local: Local scripts are when a script only shows to the user, but it registers the command when you kill someone. So therefore, it kills them on their screen but it's like their resetting. This is why its different from Server side scripts, because Local scripts dont show to everyone.
@matteo7079
@matteo7079 4 года назад
this was very use full information, Thank you electrikCryx
@smoothrequiem5374
@smoothrequiem5374 4 года назад
Mattmatters no problem :D
@coolidk9747
@coolidk9747 Год назад
But grab knife lags when it’s run ln the server unlike client, got any solution?
@mrrage9549
@mrrage9549 2 года назад
This video was so helpful! Thank u for clearing my confusion! Now I have a broader knowledge of roblox coding!
@anrovlogs2834
@anrovlogs2834 5 лет назад
Sir can you make a Video showing what is FindFirstChild and WaitForChild plsss i rlly want to learn how to script. Subscrobed!!
@GnomeCode
@GnomeCode 5 лет назад
Thanks Anro, I'll be sure to make a video on it!
@anrovlogs2834
@anrovlogs2834 5 лет назад
Ty sir i hope this channel got 100k or more subscriber
@MetaReplication
@MetaReplication 4 года назад
ok, WaitForChild is used to fix problems with the script, where sometimes you'd type a string saying game.Workspace.Part.Transparency = 0.5, and then you'd try to run it and sometimes the game might say "Part is not a valid member of Workspace", despite "Part" seemingly existing in workspace. This is happening because the script ran that line and looked for "Part" in workspace, but "Part" hasn't loaded in yet so it assumes it doesn't exist. However, if you use game.Workspace:WaitForChild("Part") then it will wait at maximum about 5 seconds for it to load (Usually it doesn't matter as the part would load in with about 0.2 seconds of time) and it will fix the problem and the script will continue running as expected.
4 года назад
FindFirstChild() is something like, if you have part you write FindFirstChild("Part"), if you have it, and make :Destroy, it will instantly dissapear, this is same for WaitForChild(), but there script *Wait* for part.
@okay4088
@okay4088 3 года назад
@@MetaReplication Even it's been a year, this is helpful. Tysm
@fusiontv5269
@fusiontv5269 5 лет назад
Great tutorial
@maskedrobloxian8043
@maskedrobloxian8043 Год назад
So did brookhaven developers make a local scriptcity which we can add in the game
@kmineblox600z
@kmineblox600z 4 года назад
If in normal scripts everybody can see properties changing but local script only you can see it so that means if you win a game of anything the reward comes from a local script or wat?
@scrobethegamer4905
@scrobethegamer4905 3 года назад
Yes!
@kmineblox600z
@kmineblox600z 3 года назад
@@scrobethegamer4905 epik
@door3545
@door3545 3 года назад
@@scrobethegamer4905 no it doesnt
@luissesaber
@luissesaber 10 месяцев назад
I have a question, I'm very new to coding and coding in roblox and I'm trying to make a hitbox, is their any way to send information/data from my local scripts to my server scripts? I want the hitbox to be client side but the damage dealt and all of that other stuff to be server sided. if I put the hitbox code in the server it has this awful delay.
@eienjirosama916
@eienjirosama916 Год назад
this is well made for explaining
@Konnekted2Much
@Konnekted2Much 4 года назад
Hey man please help me out. I made a local script f to punch. it worked for me but not for other players, I then changed it to just a script which isnt local. When me and my friend went into team test we could both punch each other but when she was losing hp on my creen. she still had full hp on her screen how to fi x that
@MLGChaosreto
@MLGChaosreto 3 года назад
If you used GUI for the health, then you have to make, that the GUI is updating automaticly, by looking how much HP every player has. If you used the normal Roblox system, then i can't help you. Because i'm a starter in Roblox Lua. But i hope i can help you with my answer.
@bear3527
@bear3527 3 года назад
Hey I need some help I've been trying to figure this out for months I can't declare a character in server script and it's really annoying
@ThanoSalt
@ThanoSalt 3 года назад
How do I make a module script animation ;-;
@rich-nt3su
@rich-nt3su 3 года назад
but how do i change a local to a server
@Jack-xm8tt
@Jack-xm8tt 2 года назад
your server verification doesn't work fix it
@Orzeb
@Orzeb 4 года назад
Ok so i have the local script in the starter gui, and i want it to clone things in replicated storage that has scripts in them, it clones it, but the scripts inside the models dont work any reason why??
@angryblobfish570
@angryblobfish570 4 года назад
Now i actually know what im doing now
@Smurfis
@Smurfis 4 года назад
Saved me a lot of headache just scrolling through the comments, Gnome if I make a local script making a part no longer collide and transparent does that mean only that one player will be able to go through that particular door/area or if I’m sneaky and run through at the same time would I get in too. Thanks in advanced for the answer I know the block would be stored with the server in workspace.. wouldn’t it?
@berlin2985
@berlin2985 4 года назад
I am currently trying to understand localscript, I know the difference but I'm confused on what a LocalPlayer is exactly.
@heetman5925
@heetman5925 3 года назад
local player is the player that the local script goes to. So if you want a local script to only affect the player you are controlling instead of having a server script that controls everyone.
@weridtem
@weridtem 9 месяцев назад
​@@heetman5925the client or player that the localscript is running for*
@FlokTheOne
@FlokTheOne 3 года назад
Thanks , but u r so slow in talking its like the video will be 5 minutes if u talk normally or with more speed
@typeable
@typeable 3 года назад
g o o e y
@Freddyjay7
@Freddyjay7 3 года назад
how do i make a auto morph script for exploits
@dpchppr
@dpchppr 4 года назад
You should get more subscriber
@grunktabulous
@grunktabulous 2 года назад
I know I'm a bit late, but I just wanted to ask how to communicate between Local and Server scripts? In GLua it's through "Net Messages" but I don't know about Roblox. Hopefully someone can reply.
@weridtem
@weridtem 9 месяцев назад
Create a remote event and use that to communicate client sided scripts (local scripts) and server sided scripts (normal scripts). Fire the event on the client to the server with the arguments that you want to pass onto and then use a roblox script connection on the server and run a function wich will provide the arguments you fired in the local script (you can also do the same for server scripts to local scripts)
@davidngo5423
@davidngo5423 4 года назад
I'm pretty late but, is there anyway to have a local script activate a script in workspace?
@GnomeCode
@GnomeCode 4 года назад
Yup, what you're looking for are called RemoteEvents. It can be quite a complicated topic but there is a very informative article on the wiki about it developer.roblox.com/en-us/articles/Remote-Functions-and-Events
@aligamiles
@aligamiles 4 года назад
Yes, Remote Functions and Remote Events
@djmetalsos
@djmetalsos 3 года назад
@@GnomeCode Can you just make a video about that?
@tobygamer_
@tobygamer_ Год назад
W
@charleychener
@charleychener 4 года назад
hello im struggeling with a script that shows a gui with all the players in and a button next to it that says "kill" and if you press it then the health = 0 help pls
@GnomeCode
@GnomeCode 4 года назад
Hi, sorry for the late response. Did you get it fixed? If not, maybe you could give me the error you're getting? Also, try joining us over on the discord for a more speedy response: discord.gg/utqq7zM
@charleychener
@charleychener 4 года назад
thank you i fixed the problem
@doggywater8982
@doggywater8982 2 года назад
So I made a punching animation and script but when I join the game it does not work. Do you know why?
@yyhhttcccyyhhttccc6694
@yyhhttcccyyhhttccc6694 Год назад
local scripts: hey i affect guis and stuff me: ok can you upgrade a sword if i tell u to? local scripts: yeah sure me: THEN ACT LIKE IT DAMN IT tutorials: hey look at this video me: STOP TALKING OR ILL SHOVE MY FIST IN YOUR FACE tutorials: uhh me: *punch* me: WHY IS THERE NO TUTORIAL ON THE INTERNET THAT HELPS
@majnkraftpopolzkuyutube4722
@majnkraftpopolzkuyutube4722 4 года назад
Ok so i've made a local part using local script and also made regen button that was supposed to regenerate that local brick, but sadly - it didn't work. So here's my question, how to script the local part, how to execute it to work? Is there any tutorial for that?
@GnomeCode
@GnomeCode 4 года назад
The thing to be aware of with local scripts is they can only run if they are placed inside a players starterpack, startergui, or startercharacter. If you're wanting to communicate between the server and the client you may also want to look into Remote Events
@majnkraftpopolzkuyutube4722
@majnkraftpopolzkuyutube4722 4 года назад
Okay, thanks
@javierdonas7813
@javierdonas7813 4 года назад
Wiki
@dedeleledede
@dedeleledede 5 лет назад
How do I get the player on a server script? For example, on a local script, it's like this: game.Players.LocalPlayer
@GnomeCode
@GnomeCode 4 года назад
If you want to access a player in a server script you need to know that players name, as the server won't automatically know which player you want. There is an event that will fire when any player joins the server, you may find this helpful. developer.roblox.com/en-us/api-reference/event/Players/PlayerAdded
@vaaalters1546
@vaaalters1546 5 лет назад
i am frenk from roblox
@anrovlogs2834
@anrovlogs2834 5 лет назад
I hope this chennel got like 100k subscriber
@pbit6439
@pbit6439 4 года назад
now 286 ;-;
@maxmorpher
@maxmorpher 3 месяца назад
ay look he got there
@determinatork4513
@determinatork4513 3 года назад
so can you change the script of a door into a local script so only you can enter if you like open it
@awttygaming2510
@awttygaming2510 Год назад
Can you tell me a list of scripts I need to make a multiplayer game I'm just starting out and all I need to know is every basic script like do I need to make a server script or data score script service I need to know what I need to make please
@InfinityBS
@InfinityBS 3 года назад
This was helpful! Now I can clearly tell the difference between them and what they are used for. Thanks!
@iceplaysroblox713
@iceplaysroblox713 3 года назад
i have a problem with a scipt in gui idk how to do it server cus it is clinent
@TFUBRAES
@TFUBRAES 2 года назад
How do I get the local player in a server script without using 'game.Players.PlayerAdded:Wait()'?
@weridtem
@weridtem 9 месяцев назад
You could use a remote event to fire from the client to the server the player
@yetnothugs
@yetnothugs 3 года назад
i cant find my serverescriptservice
@BrandonZChin
@BrandonZChin 2 года назад
Can you reduce lag by using local script to run a cframe tween animation? For example a door or window opening with tween.
@weridtem
@weridtem 9 месяцев назад
No
@KeyserS913
@KeyserS913 4 года назад
Subcrieb to this dude
@mrOOF123
@mrOOF123 4 месяца назад
i saw this health gui in the tool box, and the ''read me'' script said to put the ''HealthGui_SetupScript'' in ServerScriptStorage, and I don't know where is the ServerScriptStorage
@mrOOF123
@mrOOF123 4 месяца назад
wait nvm
@kahmauriaiken2982
@kahmauriaiken2982 Год назад
simple explantion, Server scripts appear for everyone for example if you put a kill script in serverscript then it will appear for everyone. Local Script: it only appears for the client (your own self) for example if you open a shop gui only you can see not others.
@Dhruvmallu
@Dhruvmallu 3 года назад
ye
@daymo3160
@daymo3160 3 года назад
how do i make a script activate another offline script?
@chiphand
@chiphand 2 года назад
you goddamn made effort, a like button for worth than nothing
@speakerlogin9687
@speakerlogin9687 4 года назад
I have a script in a text label in startergui.. It is a local script. And I want the text label to be the value of a string value. And when I play in an actual server it doesn't work, but it does in roblox studio???
@GnomeCode
@GnomeCode 4 года назад
Not quite sure what you mean when you say an 'actual server'. Do you mean in-game?
@EthanReed0
@EthanReed0 4 года назад
ok how the hell this guy not have 1 mil subs
@susan-cq5rs
@susan-cq5rs 4 года назад
How do I make a gui for script builder
@tokyoghoul3038
@tokyoghoul3038 5 лет назад
when i use a local script on a thing on the floor why cant my friends see me with the stuff the script gave me?
@GnomeCode
@GnomeCode 5 лет назад
A local script will only make changes to the local side (the device you're on). That's why you can open up a menu in a game without everybody else having to view it at the same time. Join me on discord (link in description) if you want extra help though :)
4 года назад
Sooo, we need to change LocalScript to Script?
@magma5267
@magma5267 4 года назад
Šoťák Šimon - Hlavný kanál yeah i guess, Local Script = Device of player Script = Everyone’s device in the server
4 года назад
@@magma5267 i know, im dev.
@magma5267
@magma5267 4 года назад
Šoťák Šimon - Hlavný kanál then why’d you ask?
@karmatheslumpgod7099
@karmatheslumpgod7099 3 года назад
I have this turret and when I kill someone with it or even move it around it looks like nothing happens on the other person's screen they dont even die what would be the problem with it?
@InfinityBS
@InfinityBS 3 года назад
Are you using localscript for the turret? If so, you should probably change it to normal server script for everybody to see it
@somedeer7739
@somedeer7739 4 года назад
i made a button you can click on but the local script never works
@thatboredinternetwanderer140
@thatboredinternetwanderer140 4 года назад
you need to use a server script
@baconcat2458
@baconcat2458 4 года назад
Would a local script be used to make an item disappear for a character that clicked on it, but have it stay there for any other players until they also click on it? And if so, how would I go about doing this? I can get the disappearing function to work, but it makes it go away for all players.
@GnomeCode
@GnomeCode 4 года назад
You'd need to write the code within a local script, but bear in mind. Local scripts won't run inside the workspace so you could try putting it inside starterplayer scripts
@baconcat2458
@baconcat2458 4 года назад
GnomeCode ok I’ll see if I can figure that out
Далее
What are Module Scripts? Roblox Scripting Explained
8:04
What Is The Best AI For Roblox Studio Scripting?
10:42
Просмотров 445 тыс.
titan tvman's plan (skibidi toilet 77)
01:00
Просмотров 4,4 млн
What are Local Scripts? Roblox Scripting Explained
9:01
Videogames That "Require" A Wiki
10:09
Просмотров 2 млн
Programming Rarity is Harder Than You Think
12:31
Просмотров 268 тыс.
I Made a Fake Warning to Scare Roblox Players
16:31
Просмотров 1,3 млн
Datastore: A Scripter's Worst Nightmare Explained
9:55
Roblox Scripting Tutorial - Ep 12 | All About Events
24:59