https://github.com/snipcola/roblox-execute
Execute scripts in Roblox using your IDE.
https://github.com/snipcola/roblox-execute
executor extension roblox vscode vscodium
Last synced: about 2 months ago
JSON representation
Execute scripts in Roblox using your IDE.
- Host: GitHub
- URL: https://github.com/snipcola/roblox-execute
- Owner: snipcola
- License: mit
- Archived: true
- Created: 2024-12-29T11:36:56.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T18:11:04.000Z (8 months ago)
- Last Synced: 2025-02-21T09:46:30.495Z (8 months ago)
- Topics: executor, extension, roblox, vscode, vscodium
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Roblox Execute
Allows for you to execute scripts in Roblox. You still need an executor, of course.
### Instructions
1. Put the following script inside of your `autoexec` folder (it might be named differently):
```lua
local Config = {
Name = "RobloxExecute",
Address = "ws://127.0.0.1:53203",
CheckInterval = 1000,
PingInterval = 1000,
CheckActiveInterval = 1000,
MinActive = 3000,
}assert(WebSocket and WebSocket.connect, "Executor doesn't support WebSockets.")
local Players = game:GetService("Players")
local Socket, Checking, LastActive
local Active = truelocal function GetStore(Key)
return getgenv()[`{Config.Name}-{Key}`]
endlocal function SetStore(Key, Value)
getgenv()[`{Config.Name}-{Key}`] = Value
endlocal function SetSocket(NewSocket)
Socket = NewSocket
LastActive = Socket and tick() or nil
endlocal function OnMessage(Text)
if Text == `{Config.Name}-Pong` then
LastActive = tick()
else
local Callback, Error = loadstring(Text)if Error then
error(Error, 2)
endtask.spawn(Callback)
end
endlocal function SetPlayerName()
local Player = Players.LocalPlayerif not Player then
Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
Player = Players.LocalPlayer
endif Socket then
Socket:Send(Player.Name)
end
endlocal function Connect()
if Checking then
return
endChecking = true
local Success, NewSocket = pcall(WebSocket.connect, Config.Address)if Success and Active then
SetSocket(NewSocket)
task.spawn(SetPlayerName)
Socket.OnMessage:Connect(OnMessage)
Socket.OnClose:Wait()
SetSocket(nil)
elseif Success and NewSocket then
NewSocket:Close()
endChecking = false
endlocal function TimeElapsed(LastTime, Threshold)
return LastTime and tick() - LastTime > Threshold / 1000
endlocal function Wait(Interval)
return task.wait((Interval and Interval > 0) and (Interval / 1000) or 0)
endlocal function Disconnect()
Active = falseif Socket then
Socket:Close()
end
endlocal ExistingDisconnect = GetStore("Disconnect")
if ExistingDisconnect and typeof(ExistingDisconnect) == "function" then
ExistingDisconnect()
endSetStore("Disconnect", Disconnect)
task.spawn(function()
Connect()while Wait(Config.CheckInterval) and Active do
Connect()
end
end)task.spawn(function()
while Wait(Config.PingInterval) and Active do
if Socket then
Socket:Send(`{Config.Name}-Ping`)
end
end
end)task.spawn(function()
while Wait(Config.CheckActiveInterval) and Active do
if Socket and TimeElapsed(LastActive, Config.MinActive) then
Socket:Close()
end
end
end)
```2. Ensure this extension is installed, your IDE is open, and attach.
3. On the bottom left of your IDE, you should see the client(s) connected.
Ensure the file extension is one of the following:
- `luau`
- `lua`
- `txt`Or, alternatively, ensure the tabs language is set to:
- `luau`
- `lua`
- `plaintext` (default)