Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script disappears from ServerScriptService?

Asked by 2 years ago

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
0
What is 'Status' In replicatedstorage? Kingu_Criminal 205 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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
0
Oh my lord I set it to -1.. Thanks so much for the help! rokkufera 6 — 2y
0
Haha! No problem rokkufera Kingu_Criminal 205 — 2y
Ad

Answer this question