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

How come when I jump my animation stops?

Asked by 9 years ago

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)

0
If you want to use animations easly, disable the Animations Localscript. Nickoakz 231 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

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 james24dj 90 — 9y
0
I'll see what I can do. GreekGodOfMLG 244 — 9y
Ad

Answer this question