Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

im trying to make a fireball script outside of a tool using .unit?

Asked by 6 years ago

ok so heres my script (goes inside local player scripts)

repeat wait() until script.Parent.Parent
p = script.Parent.Parent
mouse = p:GetMouse()
firing = false
mouse.Button1Down:Connect(function()
    if firing == false then
        firing = true
        ani = p.Character.Humanoid:LoadAnimation(script.Animation)
        ani:Play()
        wait(0.4)
        part = Instance.new("Part",workspace)
        part.CanCollide = false
        part.Anchored = false
        part.Shape = "Ball"
        part.Size = Vector3.new(3,3,3)
        part.Position = Vector3.new(p.Character.Head.Position.X, p.Character.Head.Position.Y,p.Character.Head.Position.Z)

        part.BrickColor = BrickColor.new("Maroon")
        part.Name = "FireBall"

        part.Velocity = Vector3.new(p.Character.Head.Position - mouse.hit)



        wait(1)
        firing = false
    end
end)

but my problem is near the bottom the velocity part it wants a vector3 but mouse.hit is cframe any way to work around this or fix this?

0
bump popthecorn145 16 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Change mouse.hit to mouse.Hit.p That will give you a vector3 value instead of CFrame

Ad

Answer this question