I have this game, and if the gamemode is deathmatch then it checks when a player has died and gives the team a point, but it dosent work. It stops at that playeradded part. Please help
01 | while wait() do |
02 | if repstorage.RoundTag.Value = = true then |
03 | if repstorage.GameRound.Value = = "Deathmatch" then |
04 | game.Players.PlayerAdded:connect( function (player) |
05 | player.CharacterAdded:connect( function (character) |
06 | character:WaitForChild( "Humanoid" ) |
07 | character.Humanoid.Died:connect( function () |
08 | if character.Humanoid:FindFirstChild( "creator" ) then |
09 | local tag = character.Humanoid.creator |
10 | local tColor = player.TeamColor |
11 | local kColor = tag.Value.TeamColor |
12 | if not kColor then return end |
13 | if not tColor then return end |
14 | if tColor ~ = kColor then |
15 | if kColor = = BrickColor.new( "Lime green" ) then |
Double check this, as it's been ages since I've done anything since I've worked with events such as PlayerAdded.
However, you're trying to update a scoreboard. The function, as it's being declared inside of the PlayerAdded event, will NOT run until a NEW player joins the game. So the code used to add the point cannot run, as it is withheld inside of the event handler.