Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if a remote event has been fired?

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

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

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.