Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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?

1 comment

0

bump

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.