Liampdoherty

TF2 dance thing

Jun 18th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Thanks for using im2awsm's Kazotsky Kick tool! :D")
  2. wait(1)
  3.  
  4.  
  5.  
  6. local maxStyles = 4
  7. local style1 = "rbxassetid://" .. "451775707"
  8. local style2 = "rbxassetid://" .. "452426407"
  9. local style3 = "rbxassetid://" .. "452428499"
  10. local style4 = "rbxassetid://" .. "452431028"
  11.  
  12. script.Parent.Equipped:connect(function(mouse)
  13. character = script.Parent.Parent
  14. player = game.Players:GetPlayerFromCharacter(character)
  15. idlePlay = character.Humanoid:LoadAnimation(idleAnim)
  16. character.Humanoid.WalkSpeed = 8
  17. idlePlay:Play()
  18. styleGui = script.Parent.StyleGui:Clone()
  19. styleGui.Parent = player.PlayerGui
  20. styleGui.Frame.Visible = true
  21. styleGui.Frame.Number.Text = style.Value
  22. if hasMusic == false then
  23. sound = Instance.new("Sound", player)
  24. sound.SoundId = "rbxassetid://"
  25. sound.Looped = true
  26. hasMusic = true
  27. end
  28. sound:Play()
  29.  
  30. styleGui.Frame.Plus.MouseButton1Down:connect(function()
  31. if style.Value + 1 ~= maxStyles + 1 then
  32. style.Value = style.Value + 1
  33. script.Parent.ToolTip = "Current Style: " .. style.Value
  34. styleGui.Frame.Number.Text = style.Value
  35. animChange()
  36. end
  37. end)
  38.  
  39. styleGui.Frame.Minus.MouseButton1Down:connect(function()
  40. if style.Value - 1 ~= 0 then
  41. style.Value = style.Value - 1
  42. script.Parent.ToolTip = "Current Style: " .. style.Value
  43. styleGui.Frame.Number.Text = style.Value
  44. animChange()
  45. end
  46. end)
  47. end)
  48.  
  49. function animChange()
  50. idlePlay:Stop()
  51. if style.Value == 1 then
  52. idleAnim.AnimationId = style1
  53. idlePlay = character.Humanoid:LoadAnimation(idleAnim)
  54. idlePlay:Play()
  55. elseif style.Value == 2 then
  56. idleAnim.AnimationId = style2
  57. idlePlay = character.Humanoid:LoadAnimation(idleAnim)
  58. idlePlay:Play()
  59. elseif style.Value == 3 then
  60. idleAnim.AnimationId = style3
  61. idlePlay = character.Humanoid:LoadAnimation(idleAnim)
  62. idlePlay:Play()
  63. elseif style.Value == 4 then
  64. idleAnim.AnimationId = style4
  65. idlePlay = character.Humanoid:LoadAnimation(idleAnim)
  66. idlePlay:Play()
  67. end
  68. end
  69. script.Parent.Unequipped:connect(function(mouse)
  70. sound:Stop()
  71. idlePlay:Stop()
  72. styleGui:Destroy()
  73. character.Humanoid.WalkSpeed = 16
  74. end)
Add Comment
Please, Sign In to add comment