Trying to anchor all the parts in a player to keep them from moving

Why is my current method for trying to stop a player from moving not working, or if there are any better alternatives please let me know.

script.Parent.RasenganActivate.OnServerEvent:Connect(function(player)
	player.Character.Rasengan.Handle.Transparency = 0.3
	player.Character.Rasengan.Part.Transparency = 0.3
	for i, v in pairs(player:GetChildren()) do
		if v:IsA("Part")then
			v.Anchored = true
		end
	end

You could just set the player’s WalkSpeed to 0

player.Character.Humanoid.WalkSpeed = 0
1 Like

I don’t know why I didn’t think of that, haha. Thanks.

Another solution: How to Disable Player Movement

1 Like