Here is a part of my script:
local par = script.Parent
local skill = 0
par.RemoteEvent.OnServerEvent:Connect(function(player, pos, tar)
local ani = par.Parent.Humanoid:LoadAnimation(script.Slash)
local ani2 = par.Parent.Humanoid:LoadAnimation(script.Raise)
par.Damage.Script.Disabled = false
if skill <= 4 then
ani:Play()
wait(1)
ani:Stop()
skill = skill + 1
elseif skill == 5 then
ani2:Play()
local new = game.ServerStorage.Spear:Clone()
new.Parent = par
script.Parent.Spear.Transparency = 1
local velocity = Instance.new("BodyVelocity")
local direction = pos - par.Spear.Position
velocity.Parent = new
new.CFrame = CFrame.new(par.Spear.Position, pos)
velocity.Velocity = (direction).Unit*150
velocity.MaxForce = Vector3.new(10000,10000,10000)
wait(1)
new:Destroy()
par.Spear.Transparency = 0.6
skill = 0
end
par.Damage.Script.Disabled = true
end)
So this is a script in my tool. The mouse.hit.position is sent from my local script. So basically, when I activates my tool, it will impale but when it is activated for the 6th time, the player will throw the spear. My spear in the ServerStorage and it is an union. How do I make the top point of my spear face the mouse.hit.Position?
I think it works right but probably the top surface of the part is in a different side. If so, how do you change the top surface to the spear tip?

2 comments
multiply it by cframe.angles
for line 22 just put math.huge for every high number if you want the numbers to be as high a possible