Hello I am making a gun and yeah I need the move arms thing to be filtering enabled so I used a remote event but for some reason its giving error:
Players.Sp00ked1.Backpack.Pistol.AnimateScript(RL):2: invalid argument #1 (CFrame expected, got number) >
And here are the scripts:
Script 1: LocalScript
mouse.Move:connect(function ()
--local Direction = Tool.Direction.Value
local Direction = mouse.Hit.p
local b = head.Position.Y-Direction.Y
local dist = (head.Position-Direction).magnitude
local answer = math.asin(b/dist)
script.Parent.HoldEvent:FireServer(neck, Direction, b, dist, answer,orginalC0)
-- neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0)
wait(0.1)
end)
end
Script 2: ServerScript (The Problem)
script.Parent.HoldEvent.OnServerEvent:Connect(function(neck, Direction, b, dist, answer,orginalC0)
neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0)
end)

1 comment
The first parameter of any function connected to onServerEvent is the player that fired the event.