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:
01 | local IntermissionValue = game.ReplicatedStorage.Intermission |
02 | local map 1 = game.Workspace.map 1 or game.ReplicatedStorage.Maps.map 1 |
03 | local Clown = game.ReplicatedStorage.Clown or map 1. Clown |
04 | local PlayerValue = game.ReplicatedStorage.PlayerValue |
05 | local DiedValue = game.ReplicatedStorage.DiedValue |
07 | game.Players.PlayerAdded:Connect( function (player) |
08 | player.CharacterAdded:Connect( function (character) |
09 | character:WaitForChild( "Humanoid" ).Died:Connect( function () |
10 | if PlayerValue = = 1 then |
11 | IntermissionValue.Value = 30 |
12 | map 1. Parent = game.ReplicatedStorage.Maps |
13 | Clown.Parent = game.ReplicatedStorage |
15 | if DiedValue = = PlayerValue then |
16 | IntermissionValue.Value = 30 |
17 | map 1. Parent = game.ReplicatedStorage.Maps |
18 | Clown.Parent = game.ReplicatedStorage |