Skip to content

getrenv

Adding _G and shared

Make sure to properly implement _G and shared into the Roblox environemnt, as poor implementations will result in detection vectors!

getrenv returns the Roblox global environment, which is used by the entire game. Changes to this environment will affect your executor environment as well.

function getrenv(): { any }

Parameters

Parameter Description
(none) This function takes no parameters.

Example

Overriding Roblox environment functions
1
2
3
4
5
getrenv().warn = "Hello!"
print(type(warn)) -- Output: string

getrenv().game = nil
print(game) -- Output: nil