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

Hello, I want to make sure that when all the players are dead then the game restarts a game?

Asked by 3 years ago
Edited 3 years ago

I have already tried a script but it doesn't work and the output doesn't give me an error:

local IntermissionValue = game.ReplicatedStorage.Intermission
local map1 = game.Workspace.map1 or game.ReplicatedStorage.Maps.map1
local Clown = game.ReplicatedStorage.Clown or map1.Clown
local PlayerValue = game.ReplicatedStorage.PlayerValue
local DiedValue = game.ReplicatedStorage.DiedValue

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()
            if PlayerValue == 1 then
                IntermissionValue.Value = 30
                map1.Parent = game.ReplicatedStorage.Maps
                Clown.Parent = game.ReplicatedStorage
            else
                if DiedValue == PlayerValue then
                    IntermissionValue.Value = 30
                    map1.Parent = game.ReplicatedStorage.Maps
                    Clown.Parent = game.ReplicatedStorage
                end
            end
        end)
    end)
end)
0
Im here waiting Roblox28721 10 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Where did you put the script and what kind of script is it?

0
in serverstorage and it is a normal script creepycanary 12 — 3y
0
this should be a comment but ok Xapelize 2658 — 3y
0
Try putting it in ServerScriptService, I think that should work. Roblox28721 10 — 3y
Ad

Answer this question