local anim1 = Instance.new("Animation", script) anim1.AnimationId = "rbxassetid://135371962695279" local anim2 = Instance.new("Animation", script) anim2.AnimationId = "rbxassetid://79029216508796" local player = game.Players.LocalPlayer local anim local dance = false if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then anim = player.Character.Humanoid:LoadAnimation(anim2) elseif player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then anim = player.Character.Humanoid:LoadAnimation(anim1) end local function guiinsert() local gui = Instance.new("ScreenGui", player.PlayerGui) local button = Instance.new("TextButton", gui) button.Position = UDim2.new(0.818, 0, 0.018, 0) button.Size = UDim2.new(0, 200, 0, 50) button.BackgroundColor3 = Color3.new(1, 0, 0) button.Text = "Not dancin" button.FontFace = --luckiest guy Font.new( "rbxasset://fonts/families/LuckiestGuy.json", Enum.FontWeight.Light, Enum.FontStyle.Normal ) button.TextScaled = true local corner = Instance.new("UICorner", button) local gradient = Instance.new("UIGradient", button) gradient.Color = ColorSequence.new{ ColorSequenceKeypoint.new(0, Color3.new(1, 1, 1)), ColorSequenceKeypoint.new(1, Color3.new(0.529412, 0.529412, 0.529412)) } gradient.Rotation = 90 button.TextColor3 = Color3.new(0, 0, 0) dance = false button.MouseButton1Click:Connect(function() if not dance then anim:Play() dance = true button.BackgroundColor3 = Color3.new(0, 1, 0) button.Text = "dancin" else anim:Stop() dance = false button.BackgroundColor3 = Color3.new(1, 0, 0) button.Text = "Not dancin" end end) player.Character.Humanoid.Died:Connect(function() gui:Destroy() wait(game.Players.RespawnTime + 1) guiinsert() end) end guiinsert() while wait(1) do for i,v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do if v ~= anim and dance == true then v:Stop() end end end