is it possible the ball is falling out of the world somehow?
If it hits a wall or any entity it is destroyed but they donât take damage. after 5 seconds the fireball will be destoryed.
maybe itâs hitting the wand handle and thatâs destroying it? trying adding a print(hit) with the destroy line and see what it prints.
It says that the handle is destroying it.
else
if hit.Parent.Name ~= script.Parent.Name and hit.Parent.Name ~= script.Parent.Owner.Value then
script.Parent:Destroy()
end
end
if the handle has the same parent as the script shouldnt it be fine?
I thought about that and I think it means either if it hits the handle, OR the player then it should be fine. But Im leaning towards if it hits the player its fine.
Are there any errors in output?
maybe you could check if the hit instance is the handle then cancel the event to avoid the misfire.
if hit == script.Parent.Handle then return end
Try adding that at the top of the touched function
Handle is not a valid member of Part "Workspace.FireBall
I think you forgot that the parent was the fireball
or did I put it in the wrong place?
Edit: My code:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(âHumanoidâ) then
if hit == script.Parent.Handle then return end
if hit.Parent.Name ~= script.Parent.Owner.Value then
hit.Parent.Humanoid:TakeDamage(script.Parent.Damage.Value)
script.Parent:Destroy()
end
else
if hit.Parent.Name ~= script.Parent.Name and hit.Parent.Name ~= script.Parent.Owner.Value then
script.Parent:Destroy()
end
end
end)
in that case, change it to
if hit.Name == "Handle" then return end
yeah i forgot this code was under the fireball not the wand
Still doesnât work I printed the hit it says Handle was still what destroyed it.
script.Parent.Touched:Connect(function(hit)
if hit.Name == "Handle" then return end
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= script.Parent.Owner.Value then
hit.Parent.Humanoid:TakeDamage(script.Parent.Damage.Value)
script.Parent:Destroy()
end
else
if hit.Parent.Name ~= script.Parent.Name and hit.Parent.Name ~= script.Parent.Owner.Value then
print(hit)
script.Parent:Destroy()
end
end
end)
Put it at the top like this
Thank you so much! How could I change the speed?
fireball.BodyVelocity.Velocity = script.Parent.Parent.HumanoidRootPart.CFrame.LookVector * script.Parent.Speed.Value
shouldnât you just increase the speed value since thatâs the scalar?
Oh yeah I forgot about that. Thanks!!!