Hey, i made a UTG in roblox but its kinda broken. One of the commands, Goner, used to work but now even that is broken. im trying to make a flamingo themed UTG and this is my progress.
But all of the buttons do nothing.
if you have any suggestions on what to fix in the code for it then can you tell me?
Local script in the UTG:
local InsertService = game:GetService("InsertService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("UTGRequest")
local frame = script.Parent
local targetBox = frame:WaitForChild("TargetBox")
local scroll = frame:WaitForChild("ScrollingFrame")
local modules = {
Goner = 4513235536,
Sans = 1234567890,
Bambi = 9876543210,
Oofnos = 6029377310,
Ironman = 5987956703,
Necronomicon = 6438184104,
["T Poser Mech"] = 4105413623,
["A60"] = 12180555239,
["Determination"] = 7409193749,
["Sutart Boss"] = 4938328186,
Sutart = 7496592494,
["SCP 173"] = 17234454946,
["SCP 096"] = 5972874843,
["Super Bro"] = 86206606847204,
["Siren head"] = 5239955586,
["Ancient Voodoo Child"] = 6243450493,
Rune = 6313015494,
["Gold Digger"] = 6511197834,
}
local buttonHeight = 40
local buttonPadding = 5
local index = 0
local functionNames = {"g", "load", "init", "Init", "Start", "start", "activate", "Activate", "run", "Run", "SoRetro"}
for name, moduleID in pairs(modules) do
local button = Instance.new("TextButton")
button.Name = name
button.Text = name
button.Size = UDim2.new(0.98, 0, 0, buttonHeight)
button.Position = UDim2.new(0.01, 0, 0, index * (buttonHeight + buttonPadding))
button.AnchorPoint = Vector2.new(0, 0)
button.BackgroundColor3 = Color3.fromRGB(248, 130, 109)
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.TextSize = 20
button.FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold)
button.BorderSizePixel = 0
button.TextXAlignment = Enum.TextXAlignment.Left
button.Parent = scroll
local padding = Instance.new("UIPadding")
padding.PaddingLeft = UDim.new(0, 10)
padding.Parent = button
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 12)
corner.Parent = button
button.MouseButton1Click:Connect(function()
local target = targetBox.Text
if target and target ~= "" then
local success, asset = pcall(function()
return InsertService:LoadAsset(moduleID)
end)
if not success or not asset then
warn("Failed to load asset for module: " .. name)
return
end
local moduleScript
for _, child in ipairs(asset:GetDescendants()) do
if child:IsA("ModuleScript") then
moduleScript = child
break
end
end
if not moduleScript then
warn("No ModuleScript found in asset for: " .. name)
asset:Destroy()
return
end
local ok, module = pcall(require, moduleScript)
if not ok or not module then
warn("Failed to require module: " .. name)
asset:Destroy()
return
end
local functionCalled = false
if typeof(module) == "function" then
pcall(function()
module(target)
end)
functionCalled = true
elseif typeof(module) == "table" then
for _, funcName in ipairs(functionNames) do
if typeof(module[funcName]) == "function" then
pcall(function()
module[funcName](target)
end)
functionCalled = true
break
end
end
end
if not functionCalled then
remote:FireServer(moduleID, target)
end
asset:Destroy()
end
end)
index = index + 1
end
scroll.CanvasSize = UDim2.new(0, 0, 0, index * (buttonHeight + buttonPadding))
script in server script service:
local InsertService = game:GetService("InsertService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("UTGRequest")
local functionNames = {"g", "load", "init", "Init", "Start", "start", "activate", "Activate", "run", "Run", "SoRetro"}
remote.OnServerEvent:Connect(function(player, moduleID, target)
local success, asset = pcall(function()
return InsertService:LoadAsset(moduleID)
end)
if not success or not asset then
warn("Failed to load module for: ", moduleID)
return
end
local moduleScript
for _, child in ipairs(asset:GetDescendants()) do
if child:IsA("ModuleScript") then
moduleScript = child
break
end
end
if not moduleScript then
warn("No ModuleScript found.")
asset:Destroy()
return
end
local ok, module = pcall(require, moduleScript)
if not ok then
warn("Failed to require module.")
asset:Destroy()
return
end
if typeof(module) == "function" then
pcall(function()
module(target)
end)
elseif typeof(module) == "table" then
for _, funcName in ipairs(functionNames) do
if typeof(module[funcName]) == "function" then
pcall(function()
module[funcName](target)
end)
break
end
end
end
asset:Destroy()
end)
If you have any suggestions on how to fix it, please tell me.
almost forgot, i have an event in replicated storage called “UTGRequest”