ok i just wanted to make a fireball when it touch an object to change it's size and become big (smoothly) and while it is becoming big if it touch a player the player will take damage. when it reach the size that i want the ball need to disappear but the problem is that with the script that i made the ball start becoming big and when it touch other object the script runs again so the ball never stop until it can't touch anything else here is my script
Fire.Fireball.Touched:Connect(function(touch)
local player = touch.Parent
if touch:IsDescendantOf(character) then return end
if not touched then -- i made a variable at the start of the script > local touched = false
local touched = true
Fire.Fireball.Anchored = true
velocity:Destroy() -- i used this to destroy the velocity because before this script start i wanted to ball to move
for i = 1 , 300 do
wait(0.001)
Fire.Fireball.Size = Fire.Fireball.Size + Vector3.new(1,1,1)
Fire.Fireball.other1.Size = Vector3.new(Fire.Fireball.Size.x + Fire.Fireball.Size.x*0.06 ,Fire.Fireball.Size.y + Fire.Fireball.Size.y*0.06,Fire.Fireball.Size.z + Fire.Fireball.Size.z*0.06)
Fire.Fireball.other2.Size = Vector3.new(Fire.Fireball.Size.x + Fire.Fireball.Size.x*0.06 ,Fire.Fireball.Size.y + Fire.Fireball.Size.y*0.06,Fire.Fireball.Size.z + Fire.Fireball.Size.z*0.06)
end
Fire:Destroy()
end
if touch.Parent:FindFirstChild("Humanoid") then
touch.Parent.Humanoid:TakeDamage(30)
end
end)
