Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
- --
- local soundIDs = {
- run = "2076455443",
- punch = "1060741618",
- fightStyle = "3367974639",
- punchBarrage = "7346580886"
- }
- --
- local animationIDs = {
- idle = "184721389",
- run = "252557606",
- punch = "75549420",
- jump = "97170520",
- fightStyle = "93648331",
- punchBarrage = "126753849",
- block = "188790303" -- New Block Animation
- }
- --
- local function loadAnimation(animationID, loop)
- local animation = Instance.new("Animation")
- animation.AnimationId = "rbxassetid://" .. animationID
- local animationTrack = animator:LoadAnimation(animation)
- animationTrack.Priority = Enum.AnimationPriority.Action
- animationTrack.Looped = loop or false
- return animationTrack
- end
- --
- local function playSound(soundID)
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://" .. soundID
- sound.Volume = 1
- sound.Parent = character
- sound:Play()
- sound.Ended:Connect(function() sound:Destroy() end)
- end
- --
- local idleAnimation = loadAnimation(animationIDs.idle, true)
- local punchAnimation = loadAnimation(animationIDs.punch)
- local fightStyleAnimation = loadAnimation(animationIDs.fightStyle)
- local punchBarrageAnimation = loadAnimation(animationIDs.punchBarrage)
- local blockAnimation = loadAnimation(animationIDs.block) --
- --
- local punchTool = Instance.new("Tool")
- punchTool.Name = "Punch"
- punchTool.RequiresHandle = false
- local punchBarrageTool = Instance.new("Tool")
- punchBarrageTool.Name = "Punch Barrage"
- punchBarrageTool.RequiresHandle = false
- local blockTool = Instance.new("Tool")
- blockTool.Name = "Block"
- blockTool.RequiresHandle = false
- local toolsEnabled = false
- --
- local canUsePunch = true
- punchTool.Activated:Connect(function()
- if canUsePunch then
- canUsePunch = false
- punchAnimation:Play()
- playSound(soundIDs.punch)
- task.wait(1) -- Cooldown
- canUsePunch = true
- end
- end)
- --
- local canUseBarrage = true
- punchBarrageTool.Activated:Connect(function()
- if canUseBarrage then
- canUseBarrage = false
- idleAnimation:Stop()
- punchBarrageAnimation:Play()
- playSound(soundIDs.punchBarrage)
- punchBarrageAnimation.Stopped:Connect(function()
- idleAnimation:Play()
- end)
- task.wait(1.5) -- Faster Cooldown
- canUseBarrage = true
- end
- end)
- --
- local canUseBlock = true
- blockTool.Activated:Connect(function()
- if canUseBlock then
- canUseBlock = false
- blockAnimation:Play() -- Play Block Animation
- task.wait(1) -- Cooldown
- canUseBlock = true
- end
- end)
- --
- local gui = Instance.new("ScreenGui")
- gui.Parent = game:GetService("CoreGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 250, 0, 120)
- frame.Position = UDim2.new(0.5, -125, 0.5, -60)
- frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- frame.BackgroundTransparency = 0.2
- frame.BorderSizePixel = 0
- frame.Parent = gui
- frame.Active = true
- frame.Draggable = true
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 10)
- UICorner.Parent = frame
- --
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, 0, 0, 25)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- title.Text = "WingChun Student"
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.Font = Enum.Font.GothamBold
- title.TextSize = 18
- title.Parent = frame
- local titleCorner = Instance.new("UICorner")
- titleCorner.CornerRadius = UDim.new(0, 10)
- titleCorner.Parent = title
- --
- local fightStyleButton = Instance.new("TextButton")
- fightStyleButton.Size = UDim2.new(0.9, 0, 0, 40)
- fightStyleButton.Position = UDim2.new(0.05, 0, 0, 30)
- fightStyleButton.BackgroundColor3 = Color3.fromRGB(50, 120, 255)
- fightStyleButton.Text = "Fight Style"
- fightStyleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- fightStyleButton.Font = Enum.Font.GothamBold
- fightStyleButton.TextSize = 16
- fightStyleButton.Parent = frame
- local fightStyleCorner = Instance.new("UICorner")
- fightStyleCorner.CornerRadius = UDim.new(0, 8)
- fightStyleCorner.Parent = fightStyleButton
- --
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0.9, 0, 0, 40)
- closeButton.Position = UDim2.new(0.05, 0, 0, 75)
- closeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
- closeButton.Text = "CLOSE"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Font = Enum.Font.GothamBold
- closeButton.TextSize = 16
- closeButton.Parent = frame
- local closeCorner = Instance.new("UICorner")
- closeCorner.CornerRadius = UDim.new(0, 8)
- closeCorner.Parent = closeButton
- --
- fightStyleButton.MouseEnter:Connect(function()
- fightStyleButton.BackgroundColor3 = Color3.fromRGB(80, 150, 255)
- end)
- fightStyleButton.MouseLeave:Connect(function()
- fightStyleButton.BackgroundColor3 = Color3.fromRGB(50, 120, 255)
- end)
- closeButton.MouseEnter:Connect(function()
- closeButton.BackgroundColor3 = Color3.fromRGB(220, 70, 70)
- end)
- closeButton.MouseLeave:Connect(function()
- closeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50)
- end)
- --
- fightStyleButton.MouseButton1Click:Connect(function()
- if not toolsEnabled then
- toolsEnabled = true
- local fightSound = Instance.new("Sound")
- fightSound.SoundId = "rbxassetid://" .. soundIDs.fightStyle
- fightSound.Volume = 1
- fightSound.Parent = character
- fightSound:Play()
- fightStyleAnimation:Play()
- fightStyleAnimation.Stopped:Connect(function()
- fightSound:Stop()
- fightSound:Destroy()
- idleAnimation:Play()
- --
- punchTool.Parent = player.Backpack
- punchBarrageTool.Parent = player.Backpack
- blockTool.Parent = player.Backpack
- end)
- end
- end)
- --
- closeButton.MouseButton1Click:Connect(function()
- frame:TweenSize(UDim2.new(0, 250, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.3, true, function()
- gui:Destroy()
- end)
- end) --i will test the script
Advertisement
Add Comment
Please, Sign In to add comment