Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Setup References ]]--
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local player = Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- local hotbar = playerGui:WaitForChild("Hotbar")
- local backpack = hotbar:WaitForChild("Backpack")
- local hotbarFrame = backpack:WaitForChild("Hotbar")
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- --[[ Hotbar Tool Setup ]]--
- local function setToolName(buttonIndex, name)
- local button = hotbarFrame:WaitForChild(tostring(buttonIndex))
- local base = button:WaitForChild("Base")
- local toolNameLabel = base:WaitForChild("ToolName")
- toolNameLabel.Text = name
- end
- setToolName(1, "Mario punch")
- setToolName(2, "Super beat down")
- setToolName(3, "Koopa kick") -- Updated to "Koopa kick"
- setToolName(4, "Jump-stomp")
- --[[ GUI Waiter ]]--
- local function waitForGui()
- while true do
- local screenGui = playerGui:FindFirstChild("ScreenGui")
- if screenGui then
- local magicHealthFrame = screenGui:FindFirstChild("MagicHealth")
- if magicHealthFrame then
- local textLabel = magicHealthFrame:FindFirstChild("TextLabel")
- if textLabel then
- textLabel.Text = "??"
- return
- end
- end
- end
- wait(0.5) -- Faster wait
- end
- end
- waitForGui()
- --[[ Animation Replacements ]]--
- local replacementAnimations = {
- -- Abilities
- ["13376869471"] = {id = "14003607057", speed = 1.0},
- ["10466974800"] = {id = "14046756619", speed = 1.0},
- ["10471336737"] = {id = "100558589307006", speed = 1.0},
- ["12510170988"] = {id = "13497875049", speed = 1.0},
- ["15955393872"] = {id = "15943915877", speed = 1},
- ["12447707844"] = {id = "15507137974", speed = 1},
- ["10479335397"] = {id = "17838006839", speed = 1.3, stopDelay = 1.5},
- ["10503381238"] = {id = "14900168720", startTime = 1.3, speed = 0.7},
- ["10470104242"] = {id = "12447247483", speed = 6, waitTime = 0.2},
- -- Punches
- ["10469493270"] = {id = "13491635433"},
- ["10469630950"] = {id = "17889461810"},
- ["10469639222"] = {id = "13532604085"},
- ["10469643643"] = {id = "13294471966"},
- ["17859015788"] = {id = "12684185971"},
- ["11365563255"] = {id = "14516273501"},
- }
- local animationQueue = {}
- local isAnimating = false
- local function playAnimation(animData)
- if not animData then return end
- if isAnimating then
- table.insert(animationQueue, animData)
- return
- end
- isAnimating = true
- local anim = Instance.new("Animation")
- anim.AnimationId = "rbxassetid://" .. animData.id
- local track = humanoid:LoadAnimation(anim)
- if animData.waitTime then wait(animData.waitTime) end
- track:Play()
- track:AdjustSpeed(0)
- track.TimePosition = animData.startTime or 0
- track:AdjustSpeed(animData.speed or 1)
- if animData.stopDelay then
- delay(animData.stopDelay, function()
- track:Stop()
- end)
- end
- track.Stopped:Connect(function()
- isAnimating = false
- if #animationQueue > 0 then
- local nextAnim = table.remove(animationQueue, 1)
- playAnimation(nextAnim)
- end
- end)
- end
- local function onAnimationPlayed(animTrack)
- local animId = animTrack.Animation.AnimationId:match("%d+")
- local replacement = replacementAnimations[animId]
- if replacement then
- -- No delay here for faster animation replacement
- for _, track in pairs(humanoid:GetPlayingAnimationTracks()) do
- if track ~= animTrack then
- track:Stop()
- end
- end
- animTrack:Stop()
- -- Play the replacement animation
- playAnimation(replacement)
- end
- end
- humanoid.AnimationPlayed:Connect(onAnimationPlayed)
- --[[ Character Reset Handling ]]--
- player.CharacterAdded:Connect(function(newChar)
- character = newChar
- humanoid = character:WaitForChild("Humanoid")
- humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- humanoid.AnimationPlayed:Connect(onAnimationPlayed)
- -- Velocity Fix
- character.DescendantAdded:Connect(function(d)
- if d:IsA("BodyVelocity") then
- d.Velocity = Vector3.new(d.Velocity.X, 0, d.Velocity.Z)
- end
- end)
- for _, d in ipairs(character:GetDescendants()) do
- if d:IsA("BodyVelocity") then
- d.Velocity = Vector3.new(d.Velocity.X, 0, d.Velocity.Z)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment