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

How to check if a remote event has been fired?

Asked by 3 years ago

Lets say I have a remote event called "Testing". How would I check if the remote event has been fired, or pause the code until it has been fired?


game.ReplicatedStorage.RemoteEvents.Testing:FireServer() wait(Testing) -- what would I do to wait for this event to be fired then continue the code?

Thank you!

2 answers

Log in to vote
0
Answered by 3 years ago

If you want to check if something happened then you can use

print("Something cool")

you can probably put that after you fire the event. idk

Ad
Log in to vote
0
Answered by 3 years ago

Try it like this:

game.ReplicatedStorage.GamerEvent.OnServerEvent:Connect(function()
    local eventfired = Instance.new("BoolValue", workspace)
    eventfired.Name = "EventFired"
    -- now here you put whatever you want to happen when the event is fired
end)

When the event is fired, it will make a value in workspace called "EventFired"

Also the "GamerEvent" change it to whatever the event is named, and if its parent is not replicated storage, you can just change that too!

Hope I helped!

Answer this question