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

How do you fix OnServerEvent can only be used on the server?

Asked by 4 years ago

Hello im new here and i have an error that i cannot fix

local remote = game.ReplicatedStorage.RemoteEvent

remote.OnServerEvent:Connect(function(yes, no) 
    require(script.Loadstring)(yes)()
end)

2 answers

Log in to vote
0
Answered by 4 years ago

If this is in a LocalScript you have to use remote.OnClientEvent

0
Its in a Script not LocalScript systemGene 0 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Did you try putting it in a server script?

Answer this question