So, in my game, I have an invisible sphere at the top of a ramp. It is anchored. When a person touches a brick, it is supposed to appear and become unanchored, therefore rolling down the ramp. Then, when someone touches the sphere, they are supposed to take 25 damage, and the sphere should slowly fade away, turning off cancollide. Here is the trigger script...
function onTouched(part)
script.Parent.Parent.Ball.Transparency = 0
script.Parent.Parent.Ball.Anchored = false
end
script.Parent.Touched:connect(onTouched)
And this is the ball script...
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.Health = h.Health - 25
script.Disabled = true
for i = 1, 10 do
script.Parent.Transparency = script.Parent.Transparency - 1
wait(.2)
end
script.Parent.CanCollide = false
end
end
script.Parent.Touched:connect(onTouched)
When I first enter the game (not touching my trigger AT ALL!) the ball appears and rolls down. Then, when touched, it takes away the damage, deactivates, but it doesn't disappear. Help?
