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

Why can't I fire my remote event?

Asked by 3 years ago
Edited 3 years ago

Hi there, thanks for reading. So, for my game, I was having troubles doing everything by time, so, I decided to do a remote event. The remote event's in the replicated storage, which is named Drop. Script when remote event's fired:

game.ReplicatedStorage.Drop.OnServerEvent:Connect(function(plr)

    wait(10)
    workspace.HereYouComeAgainDrop.Anchored = false
    wait(1)
    workspace.TheFirstTalkingGuiDrop.Anchored = false

end)

Script to fire it:

script.Parent.MouseButton1Click:Connect(function()

    game.ReplicatedStorage.Drop:FireClient()

    script.Parent.Parent.Parent.Enabled = false

end)

Now, this script doesn't work... It won't close the GUI, so, I don't even know if the FireClient works. If you give an answer, please help me, or correct this, instead of simply sending me to a website. I tried the remote event article on the developer website, but it didn't help. Thank you!

2 answers

Log in to vote
2
Answered by
ImTrev 344 Moderation Voter
3 years ago
Edited 3 years ago

Simple problem, you have to FireServer() since its from the client. FireClient() only works from the server and you would have to pass a "Player" param.

script.Parent.MouseButton1Click:Connect(function()

    game.ReplicatedStorage.Drop:FireServer()

    script.Parent.Parent.Parent.Enabled = false

end)
1
Hi! Thanks so much for responding, this helped! Thanks again! PadmeOragana 78 — 3y
Ad
Log in to vote
2
Answered by 3 years ago

You were supposed to write it as a FireServer

Answer this question