What i am trying to achieve: Whenever i click a button, it runs a function for all clients.
Script in SSS:
game.ReplicatedStorage.RemoteEvent:FireAllClients()
Local Script in GUI:
local function clocks()
while clock do
game.Workspace.Value.Clock.Value = game.Workspace.Value.Clock.Value - 1
sb.Frame.PC.Text = game.Workspace.Value.Clock.Value
if game.Workspace.Value.Clock.Value == 0 then
-- play sound
break
end
wait(1)
end
end
-- main
main.StartPC.MouseButton1Click:connect(function()
if clock then return end
clock = true
game.ReplicatedStorage.RemoteEvent.OnClientEvent:connect(function()
clocks()
end)
end)
Any help?

1 comment
It only runs it for 1 player instead of all players