0% found this document useful (0 votes)
30 views2 pages

Gui

The document is a Lua script for a game that creates a user interface allowing players to interact with items in the game. It includes functionalities to spawn items, check their fuel values, and manipulate a train's controls. The script also refreshes the item dropdown when items are added or removed from the workspace.
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)
30 views2 pages

Gui

The document is a Lua script for a game that creates a user interface allowing players to interact with items in the game. It includes functionalities to spawn items, check their fuel values, and manipulate a train's controls. The script also refreshes the item dropdown when items are added or removed from the workspace.
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/ 2

local library =

loadstring(game:HttpGet(('https://raw.githubusercontent.com/bloodball/-back-ups-
for-libs/main/wall%20v3')))()

local w = library:CreateWindow("A")
local b = w:CreateFolder("B")

local items = {}

for i, v in pairs(workspace.RuntimeItems:GetChildren()) do
table.insert(items, v.Name)
end

local SelectedItemName
local itemDropdown = b:Dropdown("Spawned Items", items, true,
function(selectedItem)
SelectedItemName = selectedItem
end)

local function refreshDropdown()


items = {}
for i, v in pairs(workspace.RuntimeItems:GetChildren()) do
table.insert(items, v.Name)
end
itemDropdown:Refresh(items)
end

workspace.RuntimeItems.ChildAdded:Connect(refreshDropdown)
workspace.RuntimeItems.ChildRemoved:Connect(refreshDropdown)

b:Button("Bring Item", function()


local player = game.Players.LocalPlayer
local character = player.Character
local SelectedItem = workspace.RuntimeItems:FindFirstChild(SelectedItemName)

if SelectedItem and SelectedItem.PrimaryPart and character and


character.PrimaryPart then
local hrp = character.PrimaryPart
local forwardOffset = hrp.CFrame.LookVector * 5
SelectedItem.PrimaryPart.CFrame = hrp.CFrame + forwardOffset
task.wait(.1)

game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Remotes")
:WaitForChild("Drag"):WaitForChild("RequestStartDrag"):FireServer(SelectedItem)
else
print("Nigger")
end
end)

local myLabel = b:Label("Fuel Value", {


TextSize = 25;
TextColor = Color3.fromRGB(255, 255, 255);
BgColor = Color3.fromRGB(38, 38, 38);
})

b:Button("Check Item Fuel Value", function()


if SelectedItemName then
local SelectedItem =
workspace.RuntimeItems:FindFirstChild(SelectedItemName)
if SelectedItem and SelectedItem:GetAttribute("Fuel") then
myLabel:Refresh("Fuel: " ..
tostring(SelectedItem:GetAttribute("Fuel")))
else
myLabel:Refresh("Item Has No Fuel")
end
else
myLabel:Refresh("No Item Selected")
end
end)

b:Button("Honk Train", function()


workspace.Train.TrainControls.Lever.HitBox.ClickDetector.ActivationDistance =
math.huge
fireclickdetector(workspace.Train.TrainControls.Lever.HitBox.ClickDetector)
end)
-- Item must be held
b:Button("Put Item In Fuel", function()

firetouchinterest(workspace.RuntimeItems:FindFirstChild(SelectedItemName).PrimaryPa
rt, workspace.Train.TrainControls.FuelDetect, 0)

firetouchinterest(workspace.RuntimeItems:FindFirstChild(SelectedItemName).PrimaryPa
rt, workspace.Train.TrainControls.FuelDetect, 1)
end)

You might also like