I've tried making a tool that moves your arm in the direction of your mouse, I've done a local script, server script, and remove function inside the tool
Server script code:
local Tool = script.Parent
local Character = Tool.Parent
Tool.Equipped:Connect(function()
Character = Tool.Parent
Player = game:FindService("Players"):GetPlayerFromCharacter(Character)
Root = Character:WaitForChild("HumanoidRootPart")
RightArm = Character:WaitForChild("Right Arm")
end)
Tool.Activated:Connect(function()
CFrame.new(RightArm.Position, Tool.DirectionInvoker:InvokeClient(Player).Position)
end)
Local script code:
local Tool = script.Parent
local Character = Tool.Parent
local Player = game:FindService("Players"):GetPlayerFromCharacter(Character)
local DirectionInvoker = Tool:WaitForChild("DirectionInvoker", 10)
DirectionInvoker.OnClientInvoke = function()
local NewPlayer = game.Players.LocalPlayer
if NewPlayer and NewPlayer:IsA("Player") then
local Mouse = NewPlayer:GetMouse()
if Mouse then
local Table = {
Hit = Mouse.Hit,
Position = Mouse.Hit.p,
Target = Mouse.Target
}
return Table
end
end
local Table = {
Hit = nil,
Position = Vector3.new(0,0,0),
Target = nil
}
end
The Remote Function is called DirectionInvoker
