How to get environment function is running in

Is it even possible, i think getfenv() is supposed to do that but it always retures a table that doesn’t speciify wether the script is a local or server script.

getfenv() returns the enviroment of the script, if you want to know if your script is a local script you could use script:IsA("LocalScript")

1 Like

To find the “environment” that a function is running in, RunService has a few handy methods for that (RunService:IsClient(), RunService:IsServer(), RunService:IsStudio(), etc.).

1 Like