Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to freeze player when playing a animation?

Asked by 3 years ago

i edited the fe gun kit heavily, but i cant freeze a player while playing the animation and anything i do just kinda breaks the gun here is the part im trying to edit

if Module.FireAnimationID ~= nil then local FireAnim = Instance.new("Animation",Tool) FireAnim.Name = "FireAnim" FireAnim.AnimationId = "rbxassetid://"..Module.FireAnimationID

end

1 answer

Log in to vote
0
Answered by
pwx 1581 Moderation Voter
3 years ago

Your best bet is to freeze the HumanoidRootPart. That way the animation will still play but the player themselves cannot move.

if Module.FireAnimationID ~= nil then
    Player.Character.HumanoidRootPart.Anchored = true
    local FireAnim = Instance.new("Animation",Tool) 
    FireAnim.Name = "FireAnim" 
    FireAnim.AnimationId = "rbxassetid://"..Module.FireAnimationID
end
Ad

Answer this question