A: I’m a noobie at placing scripts in the right place
B: I suck at figuring out which to put, local or normal script
C: I know a little about remotes
So can somebody help me on how to
A: make a loadcharacter button when loadcharacter is false using remotes
B: show me a few images on how to make it work (local script or normal script? Replicated Storage or ServerScriptService?)
Feel free to call me stupid or noob but at least help me a bit. Thanks! (Again this is probably my 5th or 6th time but I just don’t know where to put the scripts and what they should be.)
First of all local scripts wont work outside player/character.
So for example if i put a local script in workspace then it won’t run.
We’re using Replicated Storage when we wan’t to store something for client or server.
So server and client can see instances in Replicated Storage and Replicated First
All of the instances in ServerScriptService are equal to nil for localscript beacuse it’s not replicating to client
Module Script: A script used to store data, and functions. This script could be put wherever but it’s recommended you put it some place safe like ServerStorage if used by a regular script.
Script: This script is a server sided script. This means whatever happens in this script effects everyone’s screen. This script can be placed anywhere that isn’t ReplicatedStorage, ReplicatedFirst, or ServerStorage.
LocalScript: Another script, only effects stuff that happens on your screen unless you’re playing an animation, or sound created by a server script. This script can be placed in: StarterPlayer, StarterPack, Your Player, and StarterGui. Anywhere else and it’s likely not going to work.
RemoteEvents: These are events literally just events. Ever use a Touched event? e.g
part.Touched:Connect(function()
-- runs code inside of this function
end)
This function connects an event that runs code between.
Now let’s look at a RemoteEvent setup.
localscript:
local remote = game.ReplicatedStorage:WaitForChild("eventname") -- waiting for the event
remote:FireServer() -- this can be related to when a player touches a part as an action
serverscript:
local remote = game.ReplicatedStorage:WaitForChild("eventname") -- same event
remote.OnServerEvent:Connect(function()
-- code here
end)
Same thing as the touched event. Runs code between only when called from a localscript ‘FireServer()’ is how it’s called…
Remote Events can be placed anywhere, but you should usually just place them in ReplicatedStorage.