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

Am I doing something wrong with RemoteEvent's?

Asked by 9 years ago

Can someone tell me why this RemoteEvent won't work? I am new to RemoteEvent's and trying to figure how to get them to work.

Output show's no error's.

Script to fire it:

local plr = script.Parent.Parent.Parent.Parent

local event = game.ReplicatedStorage.RemoteEvent

script.Parent.MouseButton1Click:connect(function(plr)
    event:FireServer("t")
end)

Script for when it's fired:

local event = game.ReplicatedStorage.RemoteEvent

event.OnServerEvent:connect(function(args)
    if args == "t" then
        local m = Instance.new("Message",workspace)
        m.Text = math.random(100,999)
    end
end)

Answer this question