Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "RemoteEventGui"
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Name = "Frame"
- frame.Size = UDim2.new(0, 200, 1, 0)
- frame.Position = UDim2.new(1, -210, 0, 0) -- Fica na parte direita da tela
- frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- frame.BackgroundTransparency = 0.5
- frame.Parent = ScreenGui
- local scrollingFrame = Instance.new("ScrollingFrame")
- scrollingFrame.Size = UDim2.new(1, 0, 1, 0)
- scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0) -- Tamanho inicial
- scrollingFrame.ScrollBarThickness = 12
- scrollingFrame.Parent = frame
- local function populateRemoteList()
- local yOffset = 0 -- Para controlar a posição Y dos botões
- for _, object in pairs(game:GetDescendants()) do
- if object:IsA("RemoteEvent") or object:IsA("RemoteFunction") then
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(1, 0, 0, 40)
- button.Position = UDim2.new(0, 0, 0, yOffset)
- button.Text = object.Name
- button.BackgroundColor3 = Color3.fromRGB(200, 200, 255)
- button.Parent = scrollingFrame
- button.MouseButton1Click:Connect(function()
- if object:IsA("RemoteEvent") then
- print("Chamando RemoteEvent: " .. object.Name)
- object:FireServer() -- Chama o RemoteEvent
- elseif object:IsA("RemoteFunction") then
- print("Chamando RemoteFunction: " .. object.Name)
- object:InvokeServer() -- Chama o RemoteFunction
- end
- end)
- yOffset = yOffset + 40
- end
- end
- scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, yOffset)
- end
- populateRemoteList()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement