I tested out your script and I got a few errors. I believe they're because some things can only be done on LocalScripts. The issues I got were with LocalPlayer and GetMouse() as those can only be done on LocalScripts. GetMouse() can be used in normal scripts by using remote events (it looks like LocalPlayer is used to call GetMouse()) to change the CFrame on the server's side. With your problem, you are trying to see if the child in script.Parent:GetChildren() is BOTH the right arm and left arm when you put "and" in the if statement. You are also trying to find the child of the player's model's children, so the right arm and left arm wouldn't be in there (you would need to check the part's name, not the part's child), unless you changed the player's model (if so, it should be fine). There will also be a problem between R6 and R16; unless you set everyone's body type to R6, you woudn't see RightArm or LeftArm in R16 because they are all different parts (RightUpperArm, RightLowerArm, RightHand, LeftUpperArm, LeftLowerArm, LeftHand)
I would do this (My changes to your script):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Button1DownRemoteEvent = ReplicatedStorage:WaitForChild("Button1Down")
local Button1UpRemoteEvent = ReplicatedStorage:WaitForChild("Button1Up")
Button1DownRemoteEvent.OnServerEvent:Connect(function()
for i, v in pairs(script.Parent:GetChildren()) do
if v.name == "RightArm" or v.name == "RightUpperArm" then
v.CFrame = CFrame.new(96.354, 9.749, -190.868)
elseif v.name == "LeftArm" or v.name == "LeftUpperArm" then
v.CFrame = CFrame.new(88.072, 9.749, -190.868)
end
end
end)
Button1UpRemoteEvent.OnServerEvent:Connect(function()
for i, v in pairs(script.Parent:GetChildren()) do
if v.name == "RightArm" or v.name == "RightUpperArm" then
v.CFrame = CFrame.new(96.354, 8.833, -182.557)
elseif v.name == "LeftArm" or v.name == "LeftUpperArm" then
v.CFrame = CFrame.new(88.072, 8.833, -182.557)
end
end
end)
LocalScript:
local players = game:GetService("Players")
local plr = players.LocalPlayer
local mouse = plr:GetMouse()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Button1DownRemoteEvent = ReplicatedStorage:WaitForChild("Button1Down")
local Button1UpRemoteEvent = ReplicatedStorage:WaitForChild("Button1Up")
mouse.Button1Down:Connect(function()
Button1DownRemoteEvent:FireServer()
end)
mouse.Button1Up:Connect(function()
Button1UpRemoteEvent:FireServer()
end)
Now, this worked for me, however, it doesn't seem to do what I think you want. If you're trying to move their arms, then I would do an animation rather than changing their CFrames. If you need help on that, I can help you to the best of my ability, yet I can only help so much through this site. You will definitely need to do some research on your own on how animations work, but I'm here to help! (I have experience with animations)