hey, i need help with a part that wont face the mouse pointer and i dont know how to make it.
this is what i have made
but it doesn´t work
this is the script
game:GetService("ReplicatedStorage").Remotes.GumPistol.OnServerEvent:Connect(function(player,mousePos)
local TweenS = game:GetService("TweenService")
local Arm = Instance.new("Part")
player.Character["Right Arm"].Transparency = 1
Arm.Parent = workspace
Arm.Color = Color3.new(1, 0.839216, 0.65098)
Arm.Material = Enum.Material.SmoothPlastic
Arm.Size = Vector3.new(1,1,2)
Arm.Anchored = true
Arm.CanCollide = false
local RootPos, MousePos = Arm.Position, mousePos
Arm.CFrame = CFrame.new(RootPos, Vector3.new(MousePos.X, MousePos.Y, MousePos.Z))
Arm.CFrame = player.Character["Right Arm"].CFrame * CFrame.new(0,0,0)
wait(0.1)
local goal = {Size = Arm.Size + Vector3.new(0, 0, 50), CFrame = Arm.CFrame * CFrame.new(0, 0, -25)}
local Tween1 = TweenS:Create(Arm,TweenInfo.new(.25),goal)
Tween1:Play()
Tween1.Completed:Connect(function()
wait(.1)
local goal = {Size = Arm.Size + Vector3.new(0, 0, -48), CFrame = Arm.CFrame * CFrame.new(0, 0, 25)}
local Tween2 = TweenS:Create(Arm,TweenInfo.new(.15,Enum.EasingStyle.Bounce),goal)
Tween2:Play()
Tween2.Completed:Connect(function()
player.Character["Right Arm"].Transparency = 0
Arm:Destroy()
end)
end)
end)
anything helps