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
while wait() do if repstorage.RoundTag.Value == true then if repstorage.GameRound.Value == "Deathmatch" then game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid") character.Humanoid.Died:connect(function() if character.Humanoid:FindFirstChild("creator") then local tag = character.Humanoid.creator local tColor = player.TeamColor local kColor = tag.Value.TeamColor if not kColor then return end if not tColor then return end if tColor ~= kColor then if kColor == BrickColor.new("Lime green") then greenscore.Value = greenscore.Value + 1 elseif kColor == BrickColor.new("New Yeller") then yellowscore.Value = yellowscore.Value + 1 end end end end) end) end) end end end
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.