What I'm asking is how do you make it so if the transperancy is 0, it kills you, but if it's transperancy is 1, it doesn't do anything to you? It'll go from invisible to visible in 10 seconds. Here is the script I am using.
function onTouched (part) local h = part.Parent:findFirstChild ("Humanoid") if h~=nil then h.Health = 0 end end script.Parent.Touched:connect (onTouched)
function onTouched (part) local h = script.Parent.Parent:findFirstChild ("Humanoid") if script.Parent.Transparency == 0 then h:BreakJoints() end end script.Parent.Touched:connect(onTouched)
Hope this helps you!
part.Transparency
is the property your would manipulate within a script. You would be using a conditional statement checking to see the transparency. You would be using part
because that the parameter you used to name the object it touches in highlighted line...
---------------------------------------- function onTouched (part) ------------------------------------------
It would look something like this:
if part.Transparency == 0 then --Code for kill here end
I don't want to give you everything because I feel this is a good test for you to figure out :)
I wish you luck in learning Lua!