I want everyone in the server see the player’s arms following the mouse
i tried change the arms position in server sending to the server the arms current position in client and change for the server with tween service
can someone help me out? i realy dont know what to do
local script:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait() ; Character = Player.Character
local Torso = Character:WaitForChild'Torso'
local Neck = Torso:WaitForChild("Neck")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftArm = Torso.Parent:WaitForChild("Left Arm")
local RightArm = Torso.Parent:WaitForChild("Right Arm")
local Humanoid = Character:WaitForChild("Humanoid")
local Event = game.ReplicatedStorage.Event
Humanoid.AutoRotate = false
local HMR = Character:WaitForChild("HumanoidRootPart")
local Mouse = Player:GetMouse()
local RC0 = CFrame.new(1, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local RC1 = CFrame.new(-.5, .5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local LC0 = CFrame.new(-1, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local LC1 = CFrame.new(.5, .5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
local NeckC0 = Neck.C0
local NeckC1 = Neck.C1
local db = true
game:GetService("RunService").RenderStepped:connect(function()
local cf = workspace.CurrentCamera.CFrame.lookVector.Y
local Kek = CFrame.Angles(0, 0, math.asin(Mouse.Origin.lookVector.Y))
RightShoulder.C1 = RC1 * Kek:inverse()
LeftShoulder.C1 = LC1 * Kek
Neck.C0 = NeckC0 * CFrame.Angles(math.asin(Mouse.Origin.lookVector.Y), 0, 0):inverse()
HMR.CFrame = CFrame.new(HMR.Position, Vector3.new(Mouse.Hit.p.x, HMR.Position.Y, Mouse.Hit.p.z))
if db == true then
db = false
Event:FireServer(LeftArm.CFrame, RightArm.CFrame)
task.wait(1)
db = true
end
end)
ServerScript:
local Event = game.ReplicatedStorage.Event
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.8)
Event.OnServerEvent:Connect(function(plr, LeftCFrame, RightCFrame)
local Character = plr.Character
local Torso = Character:WaitForChild('Torso')
local LeftArm = Torso.Parent:WaitForChild("Left Arm")
local RightArm = Torso.Parent:WaitForChild("Right Arm")
local LPostion = LeftArm.Position
local RPostion = RightArm.Position
local tween1 = TweenService:Create(LeftArm, tweenInfo, { LPostion = CFrame.new(Vector3.new(LeftCFrame))})
local tween2 = TweenService:Create(RightArm, tweenInfo, {RPostion = CFrame.new(Vector3.new(RightCFrame)) })
end)