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

ServerScriptService.Script:32: attempt to index boolean with 'Value' -how do i fix that?

Asked by 1 year ago

--this is the script

local roundMsg = game.ReplicatedStorage.Values:WaitForChild("roundMsg")
local zombieCount = game.ReplicatedStorage.Values:WaitForChild("zombiesRemaining")
local zombiesAlive = game.ReplicatedStorage.Values:WaitForChild("zombiesAlive")
local gameInProgress = game.ReplicatedStorage.Values:WaitForChild("gameInProgress")
local wave = game.ReplicatedStorage.Values:WaitForChild("Wave")
local collectionservice = game:GetService("CollectionService")


while true do
    for i = 15,0,-1 do
        roundMsg.Value = "Game Starting in: "..i
        if i == 1 then
            local map = math.random(1,3)
            if map == 1 then
                game.ReplicatedStorage.Maps.Map1:Clone().Parent = workspace.Map
            end
            if map == 2 then
                game.ReplicatedStorage.Maps.Map1:Clone().Parent = workspace.Map
            end
            if map == 3 then
                game.ReplicatedStorage.Maps.Map1:Clone().Parent = workspace.Map
            end
            print(map)
            for i, v in pairs(game.Players:GetPlayers()) do
                collectionservice:AddTag(v.Character, "Alive")
                v.Character.UpperTorso.CFrame = workspace.Map:FindFirstChildOfClass("Model").Spawn.CFrame
            end
            roundMsg.Value = "Game In Progress"
            zombieCount.Value = 6
            zombiesAlive.Value = 6
            wave.Value = 1
            gameInProgress.Value = true

            repeat
                if #collectionservice:GetTagged("Alive") > 0 then
                    if zombiesAlive.Value == 0 then
                        wave.Value = wave.Value + 1
                        zombieCount.Value = 6 * wave.Value
                        zombiesAlive.Value = 6 * wave.Value
                    end
                elseif #collectionservice:GetTagged("Alive") == 0 then
                    gameInProgress = false
                end
                wait(1)
            until gameInProgress == false
            workspace.Map:ClearAllChildren()
        end
        wait(1)
    end
end
0
in line 42 and 45, you forgot to add ".Value" T3_MasterGamer 2189 — 1y
0
it worked, thanks :D junio11200 0 — 1y

Answer this question