Literally the 5th/6th time asking this

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.)

Edit: the summary is the ABCAB parts

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

1 Like

Okay, so I put a script inside a button, path it to the remote, and make it loadcharacter() and bam, it works…?

for remote event it works like

--local script
local data = "blablabla"
remoteEvent:FireServer(data)
---script 
RE.OnServerEvent:Connect(function(plr,data)
      print(data)
      local char = plr.Character
      if not char then
          plr:LoadCharacter()  
      end
end)
1 Like

okay so uh. As i said, I’m a newb/noob at remotes. I know I need to check if i fired it. can I ask: now what?

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.

1 Like

Okay, so summary: I can cross out modules and local scripts but the person who wrote this still has 5 IQ about remoteevents.

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.

1 Like

um. Can somebody do a few images because I only have about 10 IQ added to the original 5 I had about remotes.

Its a bit clear too though just no mousebutton1click

just read what I said until you understand. repetition is key.

2 Likes

okay, time to test it out for the 100th

Ill mark it as solution if it works

local scripts - only you can see it, it only works for you
normal script - everyone can see it

also wdym by placing scripts in the right place?

1 Like

LoadCharacter.rbxl (32.5 KB)

1 Like

The button would go on the Client (LocalScript), while the load character script would go in the server (Normal script)

Make sure to have a RemoveEvent in ReplicatedStorage called LoadCharacter.

Button:

script.Parent.MouseButton1Click:Connect(function()
   game:GetService("ReplicatedStorage").LoadCharacter:FireServer()
end)

LoadCharacter:

game:GetService("ReplicatedStorage").LoadCharacter.OnServerEvent:Connect(function(Player)
   Player:LoadCharacter()
end)
1 Like

oh, I guess I can learn from it too