Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = {}
- local ids = script.Animations
- function m.Idle(player, anim)
- local plyr = game.Workspace:WaitForChild(player)
- local hum = plyr:FindFirstChild('Humanoid')
- if hum then
- hum.WalkSpeed = 8
- local track = hum:LoadAnimation(ids[anim].Idle)
- track:Play()
- end
- end
- function m.Walk(player, anim, val)
- local plyr = game.Workspace:WaitForChild(player)
- local hum = plyr:FindFirstChild('Humanoid')
- if hum then
- hum.WalkSpeed = 8
- local idletrack = hum:LoadAnimation(ids[anim].Idle)
- local track = hum:LoadAnimation(ids[anim].Walk)
- if val == 'Walk' then
- idletrack:Stop()
- track:Play()
- else
- if val == 'Idle' then
- track:Stop()
- idletrack:Play()
- end
- end
- end
- end
- function m.Jab(player, anim, cd)
- local plyr = game.Workspace:WaitForChild(player)
- local hum = plyr:FindFirstChild('Humanoid')
- if hum then
- local idletrack = hum:LoadAnimation(ids[anim].Idle)
- local track = hum:LoadAnimation(ids[anim].Jab)
- idletrack:Stop()
- track:Play()
- wait(cd)
- track:Stop()
- --idletrack:Play()
- end
- end
- function m.Heavy(player, anim, cd)
- local plyr = game.Workspace:WaitForChild(player)
- local hum = plyr:FindFirstChild('Humanoid')
- if hum then
- local idletrack = hum:LoadAnimation(ids[anim].Idle)
- local track = hum:LoadAnimation(ids[anim].Heavy)
- idletrack:Stop()
- track:Play()
- wait(cd)
- track:Stop()
- --idletrack:Play()
- end
- end
- function m.Kick(player, anim, cd)
- local plyr = game.Workspace:WaitForChild(player)
- local hum = plyr:FindFirstChild('Humanoid')
- if hum then
- local idletrack = hum:LoadAnimation(ids[anim].Idle)
- local track = hum:LoadAnimation(ids[anim].Kick)
- idletrack:Stop()
- track:Play()
- wait(cd)
- track:Stop()
- --idletrack:Play()
- end
- end
- return m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement