for _, player in pairs(game.Players:GetPlayers()) do
coroutine.resume(coroutine.create(function()
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid")
print("4")
character.Humanoid.Died:wait()
print("4.5")
if character.Humanoid:FindFirstChild("creator") then
print("5")
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
print("6")
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
When a player dies and is added back to the workspace it prints 4 but it does print 5 after it trys to find creator. Please help. Im just want this script to check when a player dies and give the team who killed the player a point, like paintball or something i guess
EDIT I editted your answer, so I didnt get the error. You forgot to add.Humanoid after character on line 5. I added that but then it just printed 4 no error, just a bunch of 4's in the server output

3 comments
I'm not sure what the problem is. You said 'it prints 4 but it does prints 5 after it tries to find creator.' Don't you mean it DOESN'T print 5?
yeah dosent, so its something on line 5
do you know how to check if someone died the give a team +1 score?