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
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.
Anchor the character when the player gets smashed