Pixel.Dead.Value.Enabled is the bool value inside the pixel frame, when the function is called and the bool value is enabled, it should do the death animation..
It may be because I am doing this inside the function. Is it? If so what should I do? If not what is wrong?
while true do
wait(0.1)
Pixel.Rotation = Pixel.Rotation + 50
end
The script
local Pixel = script.Parent.Pixel
function die()
if Pixel.Dead.Value.Enabled == true then
while true do
wait(0.1)
Pixel.Rotation = Pixel.Rotation + 50
end
wait(0.5)
Pixel:TweenPosition(UDim2.new(Pixel.Position.X.Scale,Pixel.Position.X.Offset,Pixel.Position.Y.Scale,Pixel.Position.Y.Offset-500),"Out","Quad",.5)
Pixel.Rotation = 0 --Reset rotation
Pixel.Position = {0.5,-284},{0.5,201} --Start position, may need to find another method if we are doing levels.
Pixel.Dead.Value.Enabled = false --Reset value
end
end
EDIT
local Pixel = script.Parent.Pixel
function die()
if Pixel.Dead.Value.Enabled == true then
for i=1,0, +50 do
wait(0.1)
Pixel.Rotation = Pixel.Rotation = i
end
Pixel:TweenPosition(UDim2.new(Pixel.Position.X.Scale,Pixel.Position.X.Offset,Pixel.Position.Y.scale,Pixel.Position.Y.Offset-500),"Out","Quad",.5)
pixel.Rotation = 0 --Reset rotation
Pixel.Position = {0.5,-284},{0.5,201} --Start position, may need to find another method if we are doing levels.
Pixel.Dead.Value.Enabled = false --Reset value
end
end
end)

2 comments
So I would go to this to learn how to use a for loop? http://wiki.roblox.com/index.php?title=For_loop#For
I tried what you said, can you check the edit and see if it looks alright?