Ovovuevuevue

WingChun Lua version

Mar 8th, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoid = character:FindFirstChildOfClass("Humanoid")
  4. local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
  5.  
  6. --
  7. local soundIDs = {
  8. run = "2076455443",
  9. punch = "1060741618",
  10. fightStyle = "3367974639",
  11. punchBarrage = "7346580886"
  12. }
  13.  
  14. --
  15. local animationIDs = {
  16. idle = "184721389",
  17. run = "252557606",
  18. punch = "75549420",
  19. jump = "97170520",
  20. fightStyle = "93648331",
  21. punchBarrage = "126753849",
  22. block = "188790303" -- New Block Animation
  23. }
  24.  
  25. --
  26. local function loadAnimation(animationID, loop)
  27. local animation = Instance.new("Animation")
  28. animation.AnimationId = "rbxassetid://" .. animationID
  29. local animationTrack = animator:LoadAnimation(animation)
  30. animationTrack.Priority = Enum.AnimationPriority.Action
  31. animationTrack.Looped = loop or false
  32. return animationTrack
  33. end
  34.  
  35. --
  36. local function playSound(soundID)
  37. local sound = Instance.new("Sound")
  38. sound.SoundId = "rbxassetid://" .. soundID
  39. sound.Volume = 1
  40. sound.Parent = character
  41. sound:Play()
  42. sound.Ended:Connect(function() sound:Destroy() end)
  43. end
  44.  
  45. --
  46. local idleAnimation = loadAnimation(animationIDs.idle, true)
  47. local punchAnimation = loadAnimation(animationIDs.punch)
  48. local fightStyleAnimation = loadAnimation(animationIDs.fightStyle)
  49. local punchBarrageAnimation = loadAnimation(animationIDs.punchBarrage)
  50. local blockAnimation = loadAnimation(animationIDs.block) --
  51.  
  52. --
  53. local punchTool = Instance.new("Tool")
  54. punchTool.Name = "Punch"
  55. punchTool.RequiresHandle = false
  56.  
  57. local punchBarrageTool = Instance.new("Tool")
  58. punchBarrageTool.Name = "Punch Barrage"
  59. punchBarrageTool.RequiresHandle = false
  60.  
  61. local blockTool = Instance.new("Tool")
  62. blockTool.Name = "Block"
  63. blockTool.RequiresHandle = false
  64.  
  65. local toolsEnabled = false
  66.  
  67. --
  68. local canUsePunch = true
  69. punchTool.Activated:Connect(function()
  70. if canUsePunch then
  71. canUsePunch = false
  72. punchAnimation:Play()
  73. playSound(soundIDs.punch)
  74. task.wait(1) -- Cooldown
  75. canUsePunch = true
  76. end
  77. end)
  78.  
  79. --
  80. local canUseBarrage = true
  81. punchBarrageTool.Activated:Connect(function()
  82. if canUseBarrage then
  83. canUseBarrage = false
  84. idleAnimation:Stop()
  85. punchBarrageAnimation:Play()
  86. playSound(soundIDs.punchBarrage)
  87.  
  88. punchBarrageAnimation.Stopped:Connect(function()
  89. idleAnimation:Play()
  90. end)
  91.  
  92. task.wait(1.5) -- Faster Cooldown
  93. canUseBarrage = true
  94. end
  95. end)
  96.  
  97. --
  98. local canUseBlock = true
  99. blockTool.Activated:Connect(function()
  100. if canUseBlock then
  101. canUseBlock = false
  102. blockAnimation:Play() -- Play Block Animation
  103. task.wait(1) -- Cooldown
  104. canUseBlock = true
  105. end
  106. end)
  107.  
  108. --
  109. local gui = Instance.new("ScreenGui")
  110. gui.Parent = game:GetService("CoreGui")
  111.  
  112. local frame = Instance.new("Frame")
  113. frame.Size = UDim2.new(0, 250, 0, 120)
  114. frame.Position = UDim2.new(0.5, -125, 0.5, -60)
  115. frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  116. frame.BackgroundTransparency = 0.2
  117. frame.BorderSizePixel = 0
  118. frame.Parent = gui
  119. frame.Active = true
  120. frame.Draggable = true
  121.  
  122. local UICorner = Instance.new("UICorner")
  123. UICorner.CornerRadius = UDim.new(0, 10)
  124. UICorner.Parent = frame
  125.  
  126. --
  127. local title = Instance.new("TextLabel")
  128. title.Size = UDim2.new(1, 0, 0, 25)
  129. title.Position = UDim2.new(0, 0, 0, 0)
  130. title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  131. title.Text = "WingChun Student"
  132. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  133. title.Font = Enum.Font.GothamBold
  134. title.TextSize = 18
  135. title.Parent = frame
  136.  
  137. local titleCorner = Instance.new("UICorner")
  138. titleCorner.CornerRadius = UDim.new(0, 10)
  139. titleCorner.Parent = title
  140.  
  141. --
  142. local fightStyleButton = Instance.new("TextButton")
  143. fightStyleButton.Size = UDim2.new(0.9, 0, 0, 40)
  144. fightStyleButton.Position = UDim2.new(0.05, 0, 0, 30)
  145. fightStyleButton.BackgroundColor3 = Color3.fromRGB(50, 120, 255)
  146. fightStyleButton.Text = "Fight Style"
  147. fightStyleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  148. fightStyleButton.Font = Enum.Font.GothamBold
  149. fightStyleButton.TextSize = 16
  150. fightStyleButton.Parent = frame
  151.  
  152. local fightStyleCorner = Instance.new("UICorner")
  153. fightStyleCorner.CornerRadius = UDim.new(0, 8)
  154. fightStyleCorner.Parent = fightStyleButton
  155.  
  156. --
  157. local closeButton = Instance.new("TextButton")
  158. closeButton.Size = UDim2.new(0.9, 0, 0, 40)
  159. closeButton.Position = UDim2.new(0.05, 0, 0, 75)
  160. closeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
  161. closeButton.Text = "CLOSE"
  162. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  163. closeButton.Font = Enum.Font.GothamBold
  164. closeButton.TextSize = 16
  165. closeButton.Parent = frame
  166.  
  167. local closeCorner = Instance.new("UICorner")
  168. closeCorner.CornerRadius = UDim.new(0, 8)
  169. closeCorner.Parent = closeButton
  170.  
  171. --
  172. fightStyleButton.MouseEnter:Connect(function()
  173. fightStyleButton.BackgroundColor3 = Color3.fromRGB(80, 150, 255)
  174. end)
  175. fightStyleButton.MouseLeave:Connect(function()
  176. fightStyleButton.BackgroundColor3 = Color3.fromRGB(50, 120, 255)
  177. end)
  178.  
  179. closeButton.MouseEnter:Connect(function()
  180. closeButton.BackgroundColor3 = Color3.fromRGB(220, 70, 70)
  181. end)
  182. closeButton.MouseLeave:Connect(function()
  183. closeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
  184. end)
  185.  
  186. --
  187. fightStyleButton.MouseButton1Click:Connect(function()
  188. if not toolsEnabled then
  189. toolsEnabled = true
  190. local fightSound = Instance.new("Sound")
  191. fightSound.SoundId = "rbxassetid://" .. soundIDs.fightStyle
  192. fightSound.Volume = 1
  193. fightSound.Parent = character
  194. fightSound:Play()
  195.  
  196. fightStyleAnimation:Play()
  197. fightStyleAnimation.Stopped:Connect(function()
  198. fightSound:Stop()
  199. fightSound:Destroy()
  200. idleAnimation:Play()
  201.  
  202. --
  203. punchTool.Parent = player.Backpack
  204. punchBarrageTool.Parent = player.Backpack
  205. blockTool.Parent = player.Backpack
  206. end)
  207. end
  208. end)
  209.  
  210. --
  211. closeButton.MouseButton1Click:Connect(function()
  212. frame:TweenSize(UDim2.new(0, 250, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.3, true, function()
  213. gui:Destroy()
  214. end)
  215. end) --i will test the script
  216.  
Advertisement
Add Comment
Please, Sign In to add comment