Alternative mobile horn
Key RequiredUniversal

Alternative mobile horn

Universal ScriptTonicostaTonicosta 418 views 105 executesUpdated May 3, 2026
Unrated
00
Lua Script•89 lines (2901 chars)
-- === HORN BUTTON DRAGGABLE - Rails Unlimited ===
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- Criar ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "HornButtonGui"
screenGui.ResetOnSpawn = false
screenGui.Parent = playerGui

-- Frame principal (arrastável)
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 80, 0, 80)
frame.Position = UDim2.new(0.85, 0, 0.7, 0)
frame.BackgroundTransparency = 0.3
frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
frame.BorderSizePixel = 0
frame.Active = true
frame.Draggable = true
frame.Parent = screenGui

-- Deixar redondo
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 40)
corner.Parent = frame

-- Ícone de buzina (emoji)
local hornLabel = Instance.new("TextLabel")
hornLabel.Size = UDim2.new(1, 0, 1, 0)
hornLabel.BackgroundTransparency = 1
hornLabel.Text = "📯"  -- Ou use "🛎️" ou "🎺"
hornLabel.TextColor3 = Color3.fromRGB(255, 215, 0)
hornLabel.TextScaled = true
hornLabel.Font = Enum.Font.GothamBold
hornLabel.Parent = frame

-- Efeito ao clicar
local function playHorn(holding)
    -- Tenta tocar a buzina do trem atual (método mais compatível com Rails Unlimited)
    local character = player.Character or player.CharacterAdded:Wait()
    local tool = character:FindFirstChildOfClass("Tool")
    
    if tool then
        for _, sound in pairs(tool:GetDescendants()) do
            if sound:IsA("Sound") and (sound.Name:lower():find("horn") or sound.Name:lower():find("whistle")) then
                if holding then
                    sound:Play()
                    sound.Looped = true
                else
                    sound:Stop()
                    sound.Looped = false
                    sound:Play()
                end
                return
            end
        end
    end
    
    -- Fallback: simular tecla H (melhor método para Rails Unlimited)
    game:GetService("VirtualInputManager"):SendKeyEvent(true, Enum.KeyCode.H, false, game)
    wait(0.05)
    if not holding then
        game:GetService("VirtualInputManager"):SendKeyEvent(false, Enum.KeyCode.H, false, game)
    end
end

-- Conexões do botão
local isHolding = false

frame.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        isHolding = true
        playHorn(true)  -- segura a buzina
    end
end)

frame.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        isHolding = false
        playHorn(false) -- solta
    end
end)

-- Clique simples também funciona (spam sem cooldown)
frame.MouseButton1Click:Connect(function()
    playHorn(false)
end)

print("✅ Botão de Buzina criado! Arraste ele pela tela. Clique ou segure para buzinar!")

Features & Information

Horn button

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts