RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a lua script executor. Also make the gui."
-- server script local ScriptService = game:GetService("ScriptService") local function executeScript(player, script) local success, result = pcall(function() return loadstring(script)() end) if success then return result else return "Error: " .. result end end game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) if message:sub(1, 7) == "!script" then local script = message:sub(9) local result = executeScript(player, script) if type(result) == "string" then player:Chat(result) end end end) end) -- -- GUI Script local Players = game:GetService("Players") local Player = Players.LocalPlayer local ScreenGui = Instance.new("ScreenGui") local Frame = Instance.new("Frame") local TextBox = Instance.new("TextBox") local ExecuteButton = Instance.new("TextButton") ScreenGui.Parent = Player:WaitForChild("PlayerGui") Frame.Parent = ScreenGui Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) Frame.BackgroundTransparency = 0.200 Frame.BorderSizePixel = 0 Frame.Position = UDim2.new(0.5, -150, 0.5, -75) Frame.Size = UDim2.new(0, 300, 0, 150) TextBox.Parent = Frame TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) TextBox.BackgroundTransparency = 0.200 TextBox.BorderSizePixel = 0 TextBox.Position = UDim2.new(0.05, 0, 0.2, 0) TextBox.Size = UDim2.new(0.9, 0, 0.6, 0) TextBox.Text = "" TextBox.Font = Enum.Font.SourceSans TextBox.TextSize = 14.000 TextBox.TextWrapped = true ExecuteButton.Parent = Frame ExecuteButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) ExecuteButton.BackgroundTransparency = 0.200 ExecuteButton.BorderSizePixel = 0 ExecuteButton.Position = UDim2.new(0.05, 0, 0.8, 0) ExecuteButton.Size = UDim2.new(0.9, 0, 0.2, 0) ExecuteButton.Font = Enum.Font.SourceSans ExecuteButton.Text = "Execute" ExecuteButton.TextColor3 = Color3.fromRGB(0, 0, 0) ExecuteButton.TextSize = 14.000 ExecuteButton.MouseButton1Click:Connect(function() local script = TextBox.Text local result = game.ReplicatedStorage.ExecuteScript:InvokeServer(script) if type(result) == "string" then print(result) end end)