
KeylessUniversal

--// Simple Mobile-Friendly Animation GUI
--// Put this LocalScript in StarterPlayerScripts or StarterGui
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
--========================
-- EDIT HERE
--========================
local animationId = "rbxassetid://0000000000" -- put your animation id here
local animationSpeed = 1 -- 0.1 = super slow, 1 = normal, 5 = fast, etc.
local buttonName = "Play Animation"
local guiTitle = "Animation GUI"
local smallButtonText = "Open"
--========================
local playing = false
local animationTrack
local currentAnimation
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "AnimationGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = player:WaitForChild("PlayerGui")
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 280, 0, 210)
mainFrame.Position = UDim2.new(0.5, -140, 0.5, -105)
mainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Parent = screenGui
local mainCorner = Instance.new("UICorner")
mainCorner.CornerRadius = UDim.new(0, 12)
mainCorner.Parent = mainFrame
local titleBar = Instance.new("TextLabel")
titleBar.Size = UDim2.new(1, 0, 0, 35)
titleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
titleBar.BorderSizePixel = 0
titleBar.Text = guiTitle
titleBar.TextColor3 = Color3.fromRGB(255, 255, 255)
titleBar.TextScaled = true
titleBar.Font = Enum.Font.GothamBold
titleBar.Parent = mainFrame
local titleCorner = Instance.new("UICorner")
titleCorner.CornerRadius = UDim.new(0, 12)
titleCorner.Parent = titleBar
local hideButton = Instance.new("TextButton")
hideButton.Size = UDim2.new(0, 60, 0, 25)
hideButton.Position = UDim2.new(1, -65, 0, 5)
hideButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
hideButton.Text = "Hide"
hideButton.TextColor3 = Color3.fromRGB(255, 255, 255)
hideButton.TextScaled = true
hideButton.Font = Enum.Font.Gotham
hideButton.BorderSizePixel = 0
hideButton.Parent = mainFrame
local hideCorner = Instance.new("UICorner")
hideCorner.CornerRadius = UDim.new(0, 8)
hideCorner.Parent = hideButton
local closeButton = Instance.new("TextButton")
closeButton.Size = UDim2.new(0, 25, 0, 25)
closeButton.Position = UDim2.new(1, -30, 0, 5)
closeButton.BackgroundColor3 = Color3.fromRGB(170, 50, 50)
closeButton.Text = "X"
closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
closeButton.TextScaled = true
closeButton.Font = Enum.Font.GothamBold
closeButton.BorderSizePixel = 0
closeButton.Parent = mainFrame
local closeCorner = Instance.new("UICorner")
closeCorner.CornerRadius = UDim.new(0, 8)
closeCorner.Parent = closeButton
local animLabel = Instance.new("TextLabel")
animLabel.Size = UDim2.new(0, 90, 0, 25)
animLabel.Position = UDim2.new(0, 10, 0, 50)
animLabel.BackgroundTransparency = 1
animLabel.Text = "Anim ID:"
animLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
animLabel.TextScaled = true
animLabel.Font = Enum.Font.Gotham
animLabel.Parent = mainFrame
local animBox = Instance.new("TextBox")
animBox.Size = UDim2.new(0, 170, 0, 25)
animBox.Position = UDim2.new(0, 95, 0, 50)
animBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
animBox.Text = animationId
animBox.TextColor3 = Color3.fromRGB(255, 255, 255)
animBox.TextScaled = true
animBox.Font = Enum.Font.Gotham
animBox.BorderSizePixel = 0
animBox.ClearTextOnFocus = false
animBox.Parent = mainFrame
local animCorner = Instance.new("UICorner")
animCorner.CornerRadius = UDim.new(0, 8)
animCorner.Parent = animBox
local speedLabel = Instance.new("TextLabel")
speedLabel.Size = UDim2.new(0, 90, 0, 25)
speedLabel.Position = UDim2.new(0, 10, 0, 85)
speedLabel.BackgroundTransparency = 1
speedLabel.Text = "Speed:"
speedLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
speedLabel.TextScaled = true
speedLabel.Font = Enum.Font.Gotham
speedLabel.Parent = mainFrame
local speedBox = Instance.new("TextBox")
speedBox.Size = UDim2.new(0, 170, 0, 25)
speedBox.Position = UDim2.new(0, 95, 0, 85)
speedBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
speedBox.Text = tostring(animationSpeed)
speedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
speedBox.TextScaled = true
speedBox.Font = Enum.Font.Gotham
speedBox.BorderSizePixel = 0
speedBox.ClearTextOnFocus = false
speedBox.Parent = mainFrame
local speedCorner = Instance.new("UICorner")
speedCorner.CornerRadius = UDim.new(0, 8)
speedCorner.Parent = speedBox
local nameLabel = Instance.new("TextLabel")
nameLabel.Size = UDim2.new(0, 90, 0, 25)
nameLabel.Position = UDim2.new(0, 10, 0, 120)
nameLabel.BackgroundTransparency = 1
nameLabel.Text = "Button Name:"
nameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
nameLabel.TextScaled = true
nameLabel.Font = Enum.Font.Gotham
nameLabel.Parent = mainFrame
local nameBox = Instance.new("TextBox")
nameBox.Size = UDim2.new(0, 170, 0, 25)
nameBox.Position = UDim2.new(0, 95, 0, 120)
nameBox.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
nameBox.Text = buttonName
nameBox.TextColor3 = Color3.fromRGB(255, 255, 255)
nameBox.TextScaled = true
nameBox.Font = Enum.Font.Gotham
nameBox.BorderSizePixel = 0
nameBox.ClearTextOnFocus = false
nameBox.Parent = mainFrame
local nameCorner = Instance.new("UICorner")
nameCorner.CornerRadius = UDim.new(0, 8)
nameCorner.Parent = nameBox
local applyButton = Instance.new("TextButton")
applyButton.Size = UDim2.new(0, 250, 0, 28)
applyButton.Position = UDim2.new(0, 15, 0, 155)
applyButton.BackgroundColor3 = Color3.fromRGB(50, 120, 50)
applyButton.Text = "Apply Changes"
applyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
applyButton.TextScaled = true
applyButton.Font = Enum.Font.GothamBold
applyButton.BorderSizePixel = 0
applyButton.Parent = mainFrame
local applyCorner = Instance.new("UICorner")
applyCorner.CornerRadius = UDim.new(0, 10)
applyCorner.Parent = applyButton
local playButton = Instance.new("TextButton")
playButton.Size = UDim2.new(0, 250, 0, 28)
playButton.Position = UDim2.new(0, 15, 0, 187)
playButton.BackgroundColor3 = Color3.fromRGB(50, 120, 50)
playButton.Text = buttonName
playButton.TextColor3 = Color3.fromRGB(255, 255, 255)
playButton.TextScaled = true
playButton.Font = Enum.Font.GothamBold
playButton.BorderSizePixel = 0
playButton.Parent = mainFrame
local playCorner = Instance.new("UICorner")
playCorner.CornerRadius = UDim.new(0, 10)
playCorner.Parent = playButton
local smallButton = Instance.new("TextButton")
smallButton.Size = UDim2.new(0, 70, 0, 30)
smallButton.Position = UDim2.new(0, 10, 0.5, -15)
smallButton.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
smallButton.Text = smallButtonText
smallButton.TextColor3 = Color3.fromRGB(255, 255, 255)
smallButton.TextScaled = true
smallButton.Font = Enum.Font.GothamBold
smallButton.BorderSizePixel = 0
smallButton.Visible = false
smallButton.Active = true
smallButton.Parent = screenGui
local smallCorner = Instance.new("UICorner")
smallCorner.CornerRadius = UDim.new(0, 10)
smallCorner.Parent = smallButton
local function updateCharacter()
character = player.Character or player.CharacterAdded:Wait()
humanoid = character:WaitForChild("Humanoid")
end
player.CharacterAdded:Connect(function()
task.wait(1)
updateCharacter()
if playing then
task.wait(0.2)
-- restart animation after respawn if it was on
local newAnimId = animBox.Text
local newSpeed = tonumber(speedBox.Text) or animationSpeed
local animation = Instance.new("Animation")
animation.AnimationId = newAnimId
currentAnimation = animation
local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator")
animator.Parent = humanoid
animationTrack = animator:LoadAnimation(animation)
animationTrack.Looped = true
animationTrack:Play()
animationTrack:AdjustSpeed(newSpeed)
end
end)
local function stopAnimation()
playing = false
if animationTrack then
animationTrack:Stop()
animationTrack:Destroy()
animationTrack = nil
end
end
local function startAnimation()
if playing then return end
playing = true
local newAnimId = animBox.Text
local newSpeed = tonumber(speedBox.Text) or animationSpeed
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = humanoid
end
local animation = Instance.new("Animation")
animation.AnimationId = newAnimId
currentAnimation = animation
animationTrack = animator:LoadAnimation(animation)
animationTrack.Looped = true
animationTrack:Play()
animationTrack:AdjustSpeed(newSpeed)
end
applyButton.MouseButton1Click:Connect(function()
if nameBox.Text ~= "" then
playButton.Text = nameBox.Text
else
playButton.Text = buttonName
end
end)
playButton.MouseButton1Click:Connect(function()
if playing then
stopAnimation()
playButton.BackgroundColor3 = Color3.fromRGB(50, 120, 50)
playButton.Text = nameBox.Text ~= "" and nameBox.Text or buttonName
else
playButton.Text = "Stop"
playButton.BackgroundColor3 = Color3.fromRGB(150, 60, 60)
startAnimation()
end
end)
hideButton.MouseButton1Click:Connect(function()
mainFrame.Visible = false
smallButton.Visible = true
end)
smallButton.MouseButton1Click:Connect(function()
mainFrame.Visible = true
smallButton.Visible = false
end)
closeButton.MouseButton1Click:Connect(function()
stopAnimation()
screenGui:Destroy()
end)
-- Draggable for mobile and PC
local function makeDraggable(guiObject)
local dragging = false
local dragInput
local dragStart
local startPos
guiObject.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = guiObject.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
guiObject.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement
or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - dragStart
guiObject.Position = UDim2.new(
startPos.X.Scale,
startPos.X.Offset + delta.X,
startPos.Y.Scale,
startPos.Y.Offset + delta.Y
)
end
end)
end
makeDraggable(mainFrame)
makeDraggable(smallButton)



ts buns