Script doesn't freeze player

Hello Devforums users, pretty straight forward. Whenever I say a specific thing on chat it doesn’t set my characters walkspeed to normal but it prints.

image

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if msg == "scp-2521" then
			local char = player.Character
			local hrp = char:WaitForChild("Humanoid")
			if char then
				hrp.WalkSpeed = 0
				print("ter")
			end
		end
	end)
end)
1 Like

anchor the HumanoidRootPart instead

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if msg == "scp-2521" then
			local char = player.Character
			local hrp = char:WaitForChild("HumanoidRootPart")
			if hrp and char then
				hrp.Anchored = true
				print("ter")
			end
		end
	end)
end)
3 Likes