-- LocalScript local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local InsertService = game:GetService("InsertService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local rightArm = character:FindFirstChild("Right Arm") or character:FindFirstChild("RightHand") -- Function to check if the character is R6 or R15 local function isR15() return humanoid.RigType == Enum.HumanoidRigType.R15 end -- Create animations local animation1 = Instance.new("Animation") local animation2 = Instance.new("Animation") local animation3 = Instance.new("Animation") local animationL = Instance.new("Animation") local walkAnimation = Instance.new("Animation") local flyAnimation = Instance.new("Animation") local zAnimation = Instance.new("Animation") local zFollowUpAnimation = Instance.new("Animation") if isR15() then animation2.AnimationId = "rbxassetid://15392759696" animation3.AnimationId = "rbxassetid://55630898" animationL.AnimationId = "rbxassetid://10714395441" walkAnimation.AnimationId = "rbxassetid://10714174918" flyAnimation.AnimationId = "rbxassetid://15549124879" else animation1.AnimationId = "rbxassetid://55306564" animation2.AnimationId = "rbxassetid://55306564" animation3.AnimationId = "rbxassetid://42070830" animationL.AnimationId = "rbxassetid://35978913" walkAnimation.AnimationId = "rbxassetid://28440069" flyAnimation.AnimationId = "rbxassetid://35152447" end zAnimation.AnimationId = "rbxassetid://44418205" zFollowUpAnimation.AnimationId = "rbxassetid://28090053" -- Load animations onto the humanoid local animationTrack1 = humanoid:LoadAnimation(animation1) local animationTrack2 = humanoid:LoadAnimation(animation2) local animationTrack3 = humanoid:LoadAnimation(animation3) local animationTrackL = humanoid:LoadAnimation(animationL) local walkTrack = humanoid:LoadAnimation(walkAnimation) local flyTrack = humanoid:LoadAnimation(flyAnimation) local zTrack = humanoid:LoadAnimation(zAnimation) local zFollowUpTrack = humanoid:LoadAnimation(zFollowUpAnimation) -- Create sound effects local gunSound = Instance.new("Sound") gunSound.SoundId = "rbxassetid://1906350651" gunSound.Volume = 1 gunSound.Looped = false gunSound.Parent = character:WaitForChild("HumanoidRootPart") local zSound = Instance.new("Sound") zSound.SoundId = "rbxassetid://9113122694" zSound.Volume = 1 zSound.Looped = false zSound.PlaybackSpeed = 1 zSound.Parent = character:WaitForChild("HumanoidRootPart") -- Create particle emitter local particleEmitter = Instance.new("ParticleEmitter") particleEmitter.Texture = "rbxassetid://410049012" particleEmitter.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0)) particleEmitter.Lifetime = NumberRange.new(5.10) particleEmitter.Rate = 100 particleEmitter.EmissionDirection = Enum.NormalId.Bottom particleEmitter.Enabled = false particleEmitter.Parent = rightArm -- Function to play the animations in order when "K" is pressed (only for R6) local function onKeyPressK(input) if input.KeyCode == Enum.KeyCode.K and not isR15() then animationTrack1:Play() animationTrack1.Stopped:Wait() animationTrack2:Play() animationTrack2.Stopped:Wait() animationTrack3:Play() wait(0.5) -- Stop the third animation after 0.5 seconds animationTrack3:Stop() elseif input.KeyCode == Enum.KeyCode.K and isR15() then animationTrack2:Play() animationTrack2.Stopped:Wait() animationTrack3:Play() wait(0.5) -- Stop the third animation after 0.5 seconds animationTrack3:Stop() end end -- Function to play the animation with gun sound and particles when "L" is pressed local function onKeyPressL(input) if input.KeyCode == Enum.KeyCode.L then animationTrackL:Play() gunSound:Play() particleEmitter.Enabled = true wait(0.5) particleEmitter.Enabled = false end end -- Function to make the player fly and play the animation when "Q" is pressed local function onKeyPressQ(input) if input.KeyCode == Enum.KeyCode.Q then flyTrack:Play() character.HumanoidRootPart.Anchored = true character.HumanoidRootPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0, 6, 0) if isR15() then wait(flyTrack.Length) -- Wait for the duration of the animation else for i = 1, 3 do flyTrack:Play() wait(flyTrack.Length) -- Wait for the duration of the animation before playing it again end end flyTrack:Stop() character.HumanoidRootPart.Anchored = false -- Add highlight effect to the character local highlight = Instance.new("Highlight") highlight.FillColor = Color3.fromRGB(255, 255, 0) highlight.FillTransparency = 0.5 highlight.Parent = character end end -- Function to play the Z animation and follow-up animation when "Z" is pressed local function onKeyPressZ(input) if input.KeyCode == Enum.KeyCode.Z then zTrack:Play() zSound:Play() wait(2) -- Play the Z animation and sound for 2 seconds zTrack:Stop() zSound:Stop() zFollowUpTrack:Play() -- Play the follow-up animation end end -- Function to play the walk animation local function playWalk() if not walkTrack.IsPlaying then walkTrack:Play() end end -- Detect when the player starts moving humanoid.Running:Connect(function(speed) if speed > 0 then playWalk() else walkTrack:Stop() end end) -- Connect the functions to the InputBegan event UserInputService.InputBegan:Connect(onKeyPressK) UserInputService.InputBegan:Connect(onKeyPressL) UserInputService.InputBegan:Connect(onKeyPressQ) UserInputService.InputBegan:Connect(onKeyPressZ)