I am new to RemoteEvent's and trying to experiment how to use them, can someone tell me why this script work's in Studio but not in a actual game server, and tell me how to fix it?
Script to fire it:
local plr = script.Parent.Parent.Parent.Parent
local event = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Click:connect(function(plr)
event:FireServer()
end)
Script for when it's fired:
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerEvent:connect(function(args)
local m = Instance.new("Message",workspace)
m.Text = math.random(100,999)
end)

4 comments
I had a problem like this when I was using remote events, I never fixed it...
Try using
WaitForChild()for the event assignment. Remember that a server takes a little bit to load objects. If that works let me know and I will post it as the answer.output
Output please?