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

How come when I jump my animation stops?

When I hold SHIFT My animation plays smoothly, but when I jump it stops. How do I prevent that?

wait(2)

repeat
    wait()
until game.Players.LocalPlayer

player = game.Players.LocalPlayer
character = player.Character
if not character then
    character = player.CharacterAdded:wait()
end

Mouse = player:GetMouse()
humanoid = character:WaitForChild("Humanoid")
s = humanoid:LoadAnimation(game.StarterPack.WRunAnimScrip.Animation)


Mouse.KeyDown:connect(function(key)
     key = string.lower(key)
   if string.byte(key) == 48 and game.Players.LocalPlayer.TeamColor == BrickColor.new('Bright blue') then
        s:Play()
        humanoid.WalkSpeed = 50
    end
end)


Mouse.KeyUp:connect(function(key)
    key = string.lower(key)
if string.byte(key) == 48 and game.Players.LocalPlayer.TeamColor == BrickColor.new('Bright blue') then
        s:Stop()
        humanoid.WalkSpeed = 16
    end
end)

1 comment

0

If you want to use animations easly, disable the Animations Localscript.

1 answer

✓ Accepted answer

Well, There's One Theory For This To Stop This From Happening...

Well, there is a solution to this, by disabling jump while the animation is playing.

The Code

It's a function to disable it, however, due to the concept of this question, I'm not gonna create the script for you. Here's an example on how this would work, by disabling jump period.

repeat wait() until plr.Character
local chr = plr.Character

event = chr:WaitForChild('Humanoid').Changed:connect(function()
     chr.Humanoid.Jump = false
end)

Do Note That...

This script could be wrong since I did not make it in studio, but it should give you the idea on how this would work.

GreekGodOfMLG

2 comments

0

I get it.. And.. I Asked another question, "How do I make animations deal damage" can you answer that too? I'm not just an asker, I answer people too. But I am currently working on something and I seriously need help

0

I'll see what I can do.

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