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

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

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)

1 comment

0

Im here waiting

1 answer

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

3 comments

0

in serverstorage and it is a normal script

0

this should be a comment but ok

0

Try putting it in ServerScriptService, I think that should work.

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