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

Whats wrong with this script?

Asked by
duckyo01 120
9 years ago

I was trying to make a script where when the zombies killed the arms don't kill you when dead. Heres what I got,

local Zom = script.Parent
local Health = Zom.Humanoid
local arm1 = Zom.zarm1
local arm2 = Zom.zarm2
if Health == 0 then
    arm1.damage2.Disabled = true
else
    arm1.damage2.Disabled = false
    if Health == 0 then
    arm2.damage1.Disabled = true
else
    arm2.damage1.Disabled = false
    end
end
end

1 answer

Log in to vote
1
Answered by 9 years ago

Use the died function and :Destroy() to destroy the scripts.

local Zom = script.Parent
local Health = Zom.Humanoid
local arm1 = Zom.zarm1
local arm2 = Zom.zarm2
Health.Died:connect(function() --When the humanoid Dies
    arm1.damage2:Destroy() --Destroy this script
    arm2.damage1:Destroy() --And this one.
    end
end
end)

0
Doess not work. duckyo01 120 — 9y
0
The problem is probably the arms. Look in the zombie models. What are the arms and scripts called? Lua is Case Sensitive. So If you say "Print" instead of "print" It won't work because of one small mistake. EzraNehemiah_TF2 3552 — 9y
0
So I put this script inside the arm not the model right? duckyo01 120 — 9y
0
Put the script in the model. Just take a screenshot of the model in the explorer tab. I need to see what the arms and scripts are called. Is the zombie arm really called "zarm"? EzraNehemiah_TF2 3552 — 9y
View all comments (4 more)
0
Yes it is actually called zarm duckyo01 120 — 9y
0
Can you take a screenshot of your roblox studio? Also I need to see the "zarm" scripts name too. EzraNehemiah_TF2 3552 — 9y
0
How do I take a picture and send it to you? duckyo01 120 — 9y
0
There are websites where you can upload photos. EzraNehemiah_TF2 3552 — 9y
Ad

Answer this question