You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
i want the fireball to explode when it hits something, but it seems it explodes in advance?
-
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i have tried looking but there wasnt much info
heres my code
local db = false
local bodyvelocity = Instance.new("BodyVelocity",script.Parent)
bodyvelocity.P = math.huge
bodyvelocity.Velocity = CFrame.lookAt(script.Parent.Position,script.Parent.Value.Value.Position).LookVector * 50
bodyvelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
task.wait(0.5)
script.Parent.Touched:Connect(function(part)
script.Parent.Anchored = true
if db == false then
print("doin")
script.Parent.Anchored = true
print("destroying")
db = true
if script.Parent:FindFirstChild("explosion") then
script.Parent.explosion:Destroy()
end
script.Parent.Size = Vector3.new(8,8,8)
for i,part in workspace:GetPartsInPart(script.Parent) do
if part.Name == "HumanoidRootPart" then
part.Parent.Humanoid:TakeDamage(20)
end
end
game:GetService("TweenService"):Create(script.Parent,TweenInfo.new(1),{Transparency = 1}):Play()
wait(1)
script.Parent:Destroy()
script.Enabled = false
end
end)