I'm making a script, I've been trying to do it since yesterday. And I can't seem to do it. So can somebody please help me. I want a model of a ghost to disappear and reappear. That was working fine. Then I wanted it to kill if the transparency was 0.9 or under. And I want the script to continue to go for ever. And this is what I ended up with. But it doesn't work.
ghost = script.Parent
function onTouch(hit)--Anonymous functions are better but still...
if ghost.Transparency =<.9 then
hit.Parent.Humanoid.Health = 0
end
end
script.Parent.Touched:connect(onTouch)
while 1+1 == 2 do
wait()
ghost.Transparency = 1
wait(3)
ghost.Transparency = 0.9
wait(0)
ghost.Transparency = 0.8
wait(0)
ghost.Transparency = 0.7
wait(0)
ghost.Transparency = 0.6
wait(0)
ghost.Transparency = 0.5
wait(0)
ghost.Transparency = 0.4
wait(3)
ghost.Transparency = 0.5
wait(0)
ghost.Transparency = 0.6
wait(0)
ghost.Transparency = 0.7
wait(0)
ghost.Transparency = 0.8
wait(0)
ghost.Transparency = 0.9
wait(0)
end
Can somebody help me here?
|