How do you Use RemoteEvents in ServerScriptService

No what I mean is the events are in replicated storage I got them mixed up the script Is in server script

Does your explorer look something like this?

image

Yep that’s how it looks but with more events

Can you show us what the Local Script looks like then?

Wait I need local script? But how would that work if the life event is in server script

You’ll need to use a Local Script in order to receive the signal. The script is firing off an event, which doesn’t do anything if it isn’t hooked up to a piece of code to run.

WAIT OOOOOOO I think I understand so the local script would have thd code for what happens and the server calls it

Yup, exactly. Since you didn’t have the Local Script, no code is being run, and no camera explosion is being caused.

ok so the Local script would say OnserverEvent?

Since you’re saying FireAllClients in your script, it should be OnClientEvent.

Ok so since all these replies are confusing, let me explain.

a local script would have

remoteEvent:FireServer(arguments)

a server script would have

remoteEvent.OnServerEvent:Connect(function(plr, argument1, argument2)
    --code
end)

If you want the other way around then:

a server script would have

remoteEvent:FireClient(plr, argument1, argument2)

a local script would have

remoteEvent.OnClientEvent:Connect(function(argument1, argument2)
    --code
end)
4 Likes

Simple :sweat_smile: Thanks for not making it confusing XD

1 Like