0% found this document useful (0 votes)
35 views3 pages

KXRTZ

The document is a Lua script for creating a user interface (UI) in a Roblox game, specifically a GUI named 'DeadRailsUI'. It includes features such as a draggable main frame, a title bar with a close button, tab functionality, and sections for different functionalities. The script also defines buttons that execute specific actions when clicked, such as a teleportation function for a game feature called 'Fast Castle TP'.

Uploaded by

gpro20190
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views3 pages

KXRTZ

The document is a Lua script for creating a user interface (UI) in a Roblox game, specifically a GUI named 'DeadRailsUI'. It includes features such as a draggable main frame, a title bar with a close button, tab functionality, and sections for different functionalities. The script also defines buttons that execute specific actions when clicked, such as a teleportation function for a game feature called 'Fast Castle TP'.

Uploaded by

gpro20190
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

local UserInputService = game:GetService("UserInputService")

local player = game.Players.LocalPlayer

-- GUI
local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
screenGui.Name = "DeadRailsUI"
screenGui.ResetOnSpawn = false

-- Main Frame
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 400, 0, 280)
mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
mainFrame.BackgroundColor3 = Color3.fromRGB(28, 28, 36)
mainFrame.BorderSizePixel = 0
mainFrame.Parent = screenGui
Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 12)

-- Title Bar
local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 40)
titleBar.BackgroundColor3 = Color3.fromRGB(38, 38, 50)
titleBar.BorderSizePixel = 0
titleBar.Parent = mainFrame

local title = Instance.new("TextLabel")


title.Size = UDim2.new(1, -50, 1, 0)
title.Position = UDim2.new(0, 15, 0, 0)
title.Text = "Dead Rails"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.Font = Enum.Font.GothamBold
title.TextSize = 18
title.BackgroundTransparency = 1
title.TextXAlignment = Enum.TextXAlignment.Left
title.Parent = titleBar

local closeButton = Instance.new("TextButton")


closeButton.Size = UDim2.new(0, 32, 0, 32)
closeButton.Position = UDim2.new(1, -40, 0.5, -16)
closeButton.Text = "X"
closeButton.Font = Enum.Font.GothamBold
closeButton.TextSize = 16
closeButton.TextColor3 = Color3.new(1,1,1)
closeButton.BackgroundColor3 = Color3.fromRGB(200, 60, 60)
closeButton.Parent = titleBar
Instance.new("UICorner", closeButton).CornerRadius = UDim.new(0, 8)

closeButton.MouseButton1Click:Connect(function()
screenGui:Destroy()
end)

-- Drag functionality
local dragging = false
local dragStart, startPos
local function update(input)
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end

titleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = mainFrame.Position

input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)

UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
update(input)
end
end)

-- Tabs Frame
local tabsFrame = Instance.new("Frame")
tabsFrame.Size = UDim2.new(1, 0, 0, 35)
tabsFrame.Position = UDim2.new(0, 0, 0, 40)
tabsFrame.BackgroundColor3 = Color3.fromRGB(33, 33, 45)
tabsFrame.BorderSizePixel = 0
tabsFrame.Parent = mainFrame

-- Function to create tabs


local function createTab(name, order)
local tabButton = Instance.new("TextButton")
tabButton.Size = UDim2.new(0, 110, 1, 0)
tabButton.Position = UDim2.new(0, order * 115, 0, 0)
tabButton.BackgroundColor3 = Color3.fromRGB(50, 50, 70)
tabButton.Text = name
tabButton.Font = Enum.Font.Gotham
tabButton.TextSize = 14
tabButton.TextColor3 = Color3.new(1, 1, 1)
tabButton.AutoButtonColor = false
tabButton.Parent = tabsFrame
Instance.new("UICorner", tabButton).CornerRadius = UDim.new(0, 6)

-- Hover effect
tabButton.MouseEnter:Connect(function()
tabButton.BackgroundColor3 = Color3.fromRGB(70, 70, 100)
end)
tabButton.MouseLeave:Connect(function()
tabButton.BackgroundColor3 = Color3.fromRGB(50, 50, 70)
end)

return tabButton
end

-- Section container logic


local sections = {}
local function createSection(name)
local section = Instance.new("Frame")
section.Name = name
section.Size = UDim2.new(1, -20, 1, -85)
section.Position = UDim2.new(0, 10, 0, 80)
section.BackgroundTransparency = 1
section.Visible = false
section.Parent = mainFrame
sections[name] = section
return section
end

-- Dead Rails Section


local deadRails = createSection("DeadRails")

local function createButton(parent, text, position, callback)


local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 180, 0, 40)
button.Position = position
button.Text = text
button.Font = Enum.Font.Gotham
button.TextSize = 14
button.BackgroundColor3 = Color3.fromRGB(80, 80, 110)
button.TextColor3 = Color3.new(1, 1, 1)
button.Parent = parent
Instance.new("UICorner", button).CornerRadius = UDim.new(0, 6)

button.MouseEnter:Connect(function()
button.BackgroundColor3 = Color3.fromRGB(100, 100, 140)
end)
button.MouseLeave:Connect(function()
button.BackgroundColor3 = Color3.fromRGB(80, 80, 110)
end)

button.MouseButton1Click:Connect(callback)
end

createButton(deadRails, "Fast Castle TP", UDim2.new(0, 0, 0, 0), function()


loadstring(game:HttpGet("https://raw.githubusercontent.com/ringtaa/
castletpfast.github.io/refs/heads/main/FASTCASTLE.lua"))()
end)

-- Tab Switching Logic


local function showSection(name)
for secName, secFrame in pairs(sections) do
secFrame.Visible = (secName == name)
end
end

local tab1 = createTab("Dead Rails", 0)


tab1.MouseButton1Click:Connect(function()
showSection("DeadRails")
end)

-- Show default tab


showSection("DeadRails")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy