Advertisement
sijdf

Script Remote

Jan 18th, 2025
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.84 KB | Source Code | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. ScreenGui.Name = "RemoteEventGui"
  3. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  4.  
  5. local frame = Instance.new("Frame")
  6. frame.Name = "Frame"
  7. frame.Size = UDim2.new(0, 200, 1, 0)
  8. frame.Position = UDim2.new(1, -210, 0, 0)  -- Fica na parte direita da tela
  9. frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  10. frame.BackgroundTransparency = 0.5
  11. frame.Parent = ScreenGui
  12.  
  13.  
  14. local scrollingFrame = Instance.new("ScrollingFrame")
  15. scrollingFrame.Size = UDim2.new(1, 0, 1, 0)
  16. scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0) -- Tamanho inicial
  17. scrollingFrame.ScrollBarThickness = 12
  18. scrollingFrame.Parent = frame
  19.  
  20.  
  21. local function populateRemoteList()
  22.     local yOffset = 0  -- Para controlar a posição Y dos botões
  23.  
  24.  
  25.     for _, object in pairs(game:GetDescendants()) do
  26.         if object:IsA("RemoteEvent") or object:IsA("RemoteFunction") then
  27.             local button = Instance.new("TextButton")
  28.             button.Size = UDim2.new(1, 0, 0, 40)
  29.             button.Position = UDim2.new(0, 0, 0, yOffset)
  30.             button.Text = object.Name
  31.             button.BackgroundColor3 = Color3.fromRGB(200, 200, 255)
  32.             button.Parent = scrollingFrame
  33.  
  34.  
  35.             button.MouseButton1Click:Connect(function()
  36.                 if object:IsA("RemoteEvent") then
  37.                     print("Chamando RemoteEvent: " .. object.Name)
  38.                     object:FireServer()  -- Chama o RemoteEvent
  39.                 elseif object:IsA("RemoteFunction") then
  40.                     print("Chamando RemoteFunction: " .. object.Name)
  41.                     object:InvokeServer()  -- Chama o RemoteFunction
  42.                 end
  43.             end)
  44.  
  45.  
  46.             yOffset = yOffset + 40
  47.         end
  48.     end
  49.  
  50.  
  51.     scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, yOffset)
  52. end
  53.  
  54. populateRemoteList()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement