script.Parent.MouseButton1Click:Connect(function() for i,Player in pairs(game.Players:GetPlayers()) do local count = Player.PlayerGui.Start.count local Parent = Player.PlayerGui.Start.Start count.Visible = true Parent.Visible = false count.Text = 5 wait(1) count.Text = 4 wait(1) count.Text = 3 wait(1) count.Text = 2 wait(1) count.Text = 1 wait(1) count.Text = "BEGIN!" end game.Workspace["start part"]:Destroy() wait(1) game.StarterGui["Start"]:Destroy() script.Parent.Parent:Destroy() end
It's supposed to do that on everyone's screen, but it doesn't. The original worked, but only on the "player who clicked it"'s screen. Why?
Please ensure the this isn't in a "localscript" if it is, it will only run for the player who executed the script.
The Problem here is that you are using A LocalScript and trying to change something on other Clients (AKA Players). Because of FilteringEnabled this simply won't work.
RemoteEvents
is your Answer. For a guide of using RemoteEvents click Here
. Basically what you want to do is
MouseButton1Click
.
RemoteEvent:FireServer()
RemoteEvent.OnClientEvent
is fired do the CountDownRemoteEvent.OnServerEvent
RemoteEvent:FireAllClients()
start part
LocalScript
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.<REMOTE EVENT HERE>:FireServer() end) game.ReplicatedStorage.<REMOTE EVENT HERE>.OnClientEvent:Connect(function() count.Visible = true Parent.Visible = false count.Text = 5 wait(1) count.Text = 4 wait(1) count.Text = 3 wait(1) count.Text = 2 wait(1) count.Text = 1 wait(1) count.Text = "BEGIN!" wait(1) script.Parent.Parent:Destroy() end)
Server Script
game.ReplicatedStorage.<REMOTE EVENT HERE>.OnServerEvent:Connect(function() game.ReplicatedStorage.<REMOTE EVENT HERE>.FireAllClients() game.Workspace["start part"]:Destroy() end)