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

Help with RemoteEvent?

Asked by 8 years ago

ServerScript

purchaseevent:OnServerEvent(function(player, ...) -- ERROR
    print("1")
end)

LocalScript

purchaseevent:FireServer("Coins", c:WaitForChild("Coins").Value)

ServerScriptService.PurchaseScript:9: attempt to call method 'OnServerEvent' (a userdata value) I don't get why this is happening. In the LocalScript, the event is already defined, and it is called when a button is clicked, but the problem is within the ServerScript. It should work from what I am seeing but it errors out the second I start the server.

Answer this question