Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i use Remote events bruh?

Asked by 2 years ago

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.

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. NotThatFamouss 605 — 2y
0
yeah, like the person above said, scripts won't work in ReplicatedStorage. You should put it in ServerScriptService. PaleNoobs 37 — 2y

2 answers

Log in to vote
1
Answered by 2 years ago

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

Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

Event:FireServer(player)

Answer this question