Created
January 31, 2021 06:35
-
-
Save Cheatoid/fe23e327f7624efac8825e7530353344 to your computer and use it in GitHub Desktop.
Starfall | Full example, showing how to enable unrestricted clientside access to vgui library for the specific Starfall chip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
0. Assuming you can run clientside Lua (sv_allowcslua 1). | |
1. Spawn this code as a Starfall chip. | |
2. Aim on the Starfall chip! | |
3. Open ingame developer console (by default, press tilde key) and submit the following: | |
lua_run_cl LocalPlayer():GetEyeTrace().Entity.instance.env.vgui = _G.vgui | |
4. The above command will give unrestricted access to vgui library to the Starfall chip. | |
5. Be sure you trust chip's owner *before* using the above hack command on other player's SF chip!! | |
]] | |
--@client | |
--@author Cheatoid | |
local function InitializeVGUI() | |
-- Do your VGUI stuff here... | |
local frame = vgui.Create("DFrame") | |
frame:SetSize(800, 600) | |
frame:SetTitle("HTML Example!") | |
frame:Center() | |
frame:MakePopup() | |
local html = vgui.Create("DHTML", frame) | |
html:Dock(1) -- FILL | |
html:OpenURL("https://www.google.com/") | |
end | |
-- Boilerplate code to wait until vgui is available on clientside. | |
do | |
local WaitForVGUI | |
function WaitForVGUI(callback) | |
if vgui then callback() else timer.simple(1.0, function() WaitForVGUI(callback) end) end | |
end | |
WaitForVGUI(InitializeVGUI) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment