Need help with FireAllClients

Im currently making a live event, and the goal for the end is the screen to fade to white. Ive got the fade working, however, adding the FireAllClients thing into my script gives this error:

“Workspace.Event.Scripts.Fade:3: Ambiguous syntax: this looks like an argument list for a function call, but could also be a start of new statement”

Im extremely new to scripting, so help is appreciated.

Provide us with the code and we’ll help you.

script.Parent.Parent.Events.Event.Event:Connect(function()

wait(5)

(game.Workspace.Event.Events.Screen):FireAllClients()

end)

What is “Event”? You’re connecting a function to it, that’s most likely the problem.

game.Workspace.Event.Events.Screen:FireAllClients()

You do not need the extra ()'s.

It’s ambiguous because it’s the same as writing

wait(5)(game.Workspace.Event.Events.Screen):FireAllCients()

If the wait function returned a function, which is valid Lua, then the next brackets would call that function, the result of which would then be indexed for FindAllClients

Remove the parentheses to clear the ambiguity.

wait(5)
game.Workspace.Event.Events.Screen:FireAllCients()
2 Likes

For your screen gui, put your remote event in ReplicatedStorage and remove the parentheses.