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

Boolean value after hit/damage not changing?

Asked by
TechModel 118
3 years ago
Edited 3 years ago

Hello! I'm asking is how to get the player that damages another player, not kill them? I know there is this function, "creator" but it only works when the creator kills (true?) What I'm showing you is a LocalScript in StarterCharacterScripts and I want this to affect everyone, and if they do damage to anyone, their bool value.stats go true. But in this case, it doesn't work, so how do I fix this? Thanks in advance.

local Humanoid = game.Players.LocalPlayer --.Character.Humanoid
    function Damage() 
    local tag = Humanoid:findFirstChild("creator") 
    if tag ~= nil then 
        if tag.Value ~= nil then 
            local Leaderstats = tag.Value:findFirstChild("Status") 
            if Leaderstats ~= nil then 
                Leaderstats.Value = true
            end 
        end 
    end 
end 
Humanoid.Character.Humanoid.HealthChanged:connect(Damage)
0
If what was shown is a serverscript then using game.Players.LocalPlayer (line 1) shouldn't be possible? EmK530 143 — 3y
0
It's a LocalScript in StarterCharacterScripts. What I said was wrong. oop TechModel 118 — 3y

Answer this question