Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with finding "creator"?

Asked by 9 years ago
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

No error in output, just a bunch of 4's

Answer this question