How to make the part move with the player

hey i have a part that i have no idea how to move with the player, i`ve tried a couple of things to do it but it wont help

this is how it looks like

this is my script

game:GetService("ReplicatedStorage").Remotes.GumGumBazoka.OnServerEvent:Connect(function(player,mousePos)
	local animation = Instance.new("Animation")
	animation.AnimationId = "rbxassetid://10236450904"
	local AT = player.Character.Humanoid:LoadAnimation(animation)
	AT.Looped = true
	AT:Play()
	player.Character["Right Arm"].Transparency = 1
	player.Character["Left Arm"].Transparency = 1
	local Arm = Instance.new("Part")
	local Arm2 = Instance.new("Part")
	Arm.Parent = workspace
	Arm2.Parent = workspace
	Arm.Size = Vector3.new(1,1,2)
	Arm2.Size = Vector3.new(1,1,2)
	Arm.Material = Enum.Material.SmoothPlastic
	Arm2.Material = Enum.Material.SmoothPlastic
	Arm.Color = Color3.new(1, 0.839216, 0.65098)
	Arm2.Color = Color3.new(1, 0.839216, 0.65098)
	Arm.CFrame = player.Character["Right Arm"].CFrame
	Arm2.CFrame = player.Character["Left Arm"].CFrame
	Arm.CanCollide = false
	Arm2.CanCollide = false
	Arm.Anchored = true
	Arm2.Anchored = true
	Arm.CFrame = CFrame.new(Arm.CFrame.p,mousePos)
	Arm2.CFrame = CFrame.new(Arm2.CFrame.p,mousePos)
	local TweenS = game:GetService("TweenService")
	local goal1 = {Size = Arm.Size + Vector3.new(0, 0, 30), CFrame = Arm.CFrame * CFrame.new(0, 0, 15)}
	local Tween1 = TweenS:Create(Arm,TweenInfo.new(1,Enum.EasingStyle.Bounce),goal1)
	Tween1:Play()
	local goal = {Size = Arm2.Size + Vector3.new(0, 0, 30), CFrame = Arm2.CFrame * CFrame.new(0, 0, 15)}
	local Tween2 = TweenS:Create(Arm2,TweenInfo.new(1,Enum.EasingStyle.Bounce),goal)
	Tween2:Play()
	game:GetService("ReplicatedStorage").Remotes.StartGumGumBazoka.OnServerEvent:Connect(function(player,mousePos)
		
	end)
end)
1 Like

When you fire the server to set the CFrame of the player’s left and right arms, it will only fire once and the arms won’t move again after that because it’s not in a loop.

I suggest moving the arms in a Heartbeat loop within a local script, and after continuous intervals (maybe a wait(1/15) or wait(1/20) in a while loop, send a remote event to the server with the CFrame of the arms, and the player’s character as the arguments. Finally, fire all clients (except for the original player that moved their arms) with the same arguments and update the CFrame of that character’s arms.

This way, the player’s arms will continuously follow the player, and it will be replicated to all the other players in the server.