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

Script disappears from ServerScriptService?

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

1 comment

0

What is 'Status' In replicatedstorage?

1 answer

✓ Accepted answer

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

2 comments

0

Oh my lord I set it to -1.. Thanks so much for the help!

0

Haha! No problem rokkufera

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