Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to freeze the entire character?

I'm trying to make a sort of smashing system that will make players freeze when tool.Deactivated. How can I accomplish this? I've thought of doing :AdjustSpeed(0) but what I'm trying to freeze is the entirety of the character not just a certain animation.

(What I mean by Freeze is players cannot walk to any direction and is stuck to the keyframe of smashTrack.)

This is the script I have:

local tool = script.Parent

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local charge = script.Charge
local smash = script.Smash

local chargeTrack = humanoid:LoadAnimation(charge)
local smashTrack = humanoid:LoadAnimation(smash)

local charged = false
local cooldown = false

tool.Activated:Connect(function()
	if not cooldown then
		cooldown = true

		if not charged then
			smashTrack:Stop()
			chargeTrack:Play()
			delay(chargeTrack.Length-0.05, function()
				chargeTrack:AdjustSpeed(0)
			end)

			charged = true
		end

		wait(1)
		cooldown = false
	end
end)

tool.Deactivated:Connect(function()	
	if charged then
		chargeTrack:Stop()
		smashTrack:Play()

		charged = false
	end
end)

2 comments

0

Either 1. weld the character parts when the keyframe is hit or 2. anchor every part of the character. You may also want to disable movement controls.

0

Anchor the character when the player gets smashed

1 answer

✓ Accepted answer

Just anchor the HumanoidRootPart.

This discussion is preserved as it was. New answers, comments, and votes are closed.