Universal Script 📌
7.3k Views
2.1k Executions

Lay button

Universal Script 📌
Cadhoun
Cadhoun10K executions
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Nothing, u can just lay

View Raw
local player = game.Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
screenGui.ResetOnSpawn = false -- Asegura que la interfaz no se reinicie con el personaje
screenGui.Parent = player:WaitForChild("PlayerGui")

-- Botón "Lay"
local layButton = Instance.new("TextButton")
layButton.Size = UDim2.new(0.05, 0, 0.05, 0) -- Tamaño pequeño
layButton.Position = UDim2.new(0.4, 0, 0.4, 0)
layButton.Text = "Lay"
layButton.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5) -- Gris
layButton.BackgroundTransparency = 0.48 -- 48% transparente
layButton.Parent = screenGui

-- Variable para rastrear si el personaje está acostado
local isLaying = false

-- Función para alternar entre acostarse y regresar a la posición normal
layButton.MouseButton1Click:Connect(function()
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    local rootPart = character:FindFirstChild("HumanoidRootPart")

    if humanoid and rootPart then
        if isLaying then
            -- Volver a la posición normal
            humanoid.PlatformStand = false
            rootPart.CFrame = rootPart.CFrame * CFrame.Angles(math.rad(-90), 0, 0) -- Revertir la rotación
            isLaying = false
        else
            -- Acostarse
            humanoid.PlatformStand = true
            rootPart.CFrame = rootPart.CFrame * CFrame.Angles(math.rad(90), 0, 0) -- Acostar al personaje
            isLaying = true
        end
    end
end)

-- Botón "Remove"
local removeButton = Instance.new("TextButton")


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
40.2k
817.4k
Bumped 1 hour ago
Universal Script 📌
133.5k
24.2k
Bumped 2 hours ago
Key System
Universal Script 📌
111
9
Approved 2 hours ago
Universal Script 📌
103
4
Approved 2 hours ago
Universal Script 📌
6.5k
118
Bumped 3 hours ago