Wand not working

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.

1 Like

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?

1 Like

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?

No errors are in the output @TazeredFireball211

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

1 Like

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?

1 Like

Oh yeah I forgot about that. Thanks!!!

1 Like