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

How can I make this script kill people who don't have ZAnimate? [Unsolved!]

Asked by 9 years ago

How can I make this script everytime the brick is touched if they don't have ZAnimate in there Character they die. It works only 1 time then it breaks or something

function onHit(hit)
    local human = hit.Parent:findFirstChild("Humanoid")

if not hit.Parent:FindFirstChild("ZAnimate") then
    hit.Parent.Torso:remove()
end

    end

script.Parent.Touched:connect(onHit)

1 answer

Log in to vote
0
Answered by
Nymint 85
9 years ago
function onHit(hit)
local human=hit.Parent:findFirstChild("Humanoid")
if human then if hit.Parent:FindFirstChild("ZAnimate")==nil then
hit.Parent.Torso:remove()
script.Parent.Disabled=true
end end end
script.Parent.Touched:connect(onHit)

If the problem is still going, it's probably because of "script.Parent.Disabled=true".

0
what if we remove it ? PancakeAttacks 0 — 9y
0
You should remove it, if you have that script inside a Part, then it's useless because you're doing script > Parent(Part) > Disabled=true (?) A part does not have a "Disabled" property unless script.Parent it's a Script too, again it would be useless because if it the parent was a script too, then script.Parent.Touched event it's completely useless. Nymint 85 — 9y
Ad

Answer this question