Skip to content

Instantly share code, notes, and snippets.

@Cheatoid
Created January 31, 2021 06:35
Show Gist options
  • Save Cheatoid/fe23e327f7624efac8825e7530353344 to your computer and use it in GitHub Desktop.
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
--[[
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