Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i use Remote events bruh?

So im trying to learn how remote functions work but i cant figure them out, this is the LocalScript

Local ReplicatedStorage = game:GetService("ReplicatedStorage")
Local Event = ReplicatedStorage:WaitForChild("Event")

script.Parent.MouseButton1Click:Connect(function()
Event:FireServer()

end)

and this is the normal script (its inside the event btw)

script.Parent.OnServerEvent:Connect(function(player)
print(player.Name)

end)

but yet i get no errors, but nothing happens.

2 comments

0

Say... Why do you have your script in ReplicatedStorage? And why does the L's of the locals are capital? FYI Scripts and LocalScripts don't work in ReplicatedStorage, only ModuleScripts do.

0

yeah, like the person above said, scripts won't work in ReplicatedStorage. You should put it in ServerScriptService.

2 answers

✓ Accepted answer

The normal script should be inside of ServerScriptService, NOT the event. Hope this helps!

first in the localscript add a local the get the player next add the local to the fireserver like this

Event:FireServer(player)

This discussion is preserved as it was. New answers, comments, and votes are closed.