I'm trying to make a round system for my game but.. whenever I playtest it, the script disappears from ServerScriptService and the timer is set to -1. Could someone please help? Here is the script:
local RS = game:GetService("ReplicatedStorage") local SS = game:GetService("ServerStorage") local roundStarted = RS:WaitForChild("roundStarted") local Timer = RS:WaitForChild("Timer") local Status = RS:WaitForChild("Status") --// MAIN SCRIPT --\\ while wait() do if Status.Value == "Intermission" then Timer.Value = 30 SS:WaitForChild("Teleport Pads").Parent = workspace SS:WaitForChild("WaitForPlayers").Parent = workspace while wait(1) do Timer.Value =- 1 if Timer.Value == 0 then Status.Value = "Round" break end end end if Status.Value == "Round" then Timer.Value = 80 workspace:WaitForChild("Teleport Pads").Parent = SS workspace:WaitForChild("WaitForPlayers").Parent = SS while wait(1) do Timer.Value =- 1 if Timer.Value == 0 then Status.Value = "Intermission" break end end end end
When you playtest the game, you obviously cannot access serverscriptservice because you are playing on the client. If you could, roblox would be riddled with exploiters and no game would be safe. Go to TEST tab in roblox, and switch from client to server. Also, You are setting the timer to -1.
--do not do this Timer.Value =- 1 --do this or this Timer.Value -= 1 Timer.Value = Timer.Value -1