optimisticside / luaul

The Luau compiler implemented in Luau (work in progress)
MIT License
23 stars 3 forks source link

Better Roblox detection #1

Closed randomizednum closed 2 years ago

randomizednum commented 2 years ago

Using _VERSION isn't a good idea, the code might be written in Luau outside of Roblox. I simply checked if the value of game is nil or not. There isn't a variable named game in the code, so using it would make sense.

Another way of doing this would be adding:

Vector3 and type(Vector3) == "table" and type(Vector3.new) == "function" and type(Vector3.new()) == "vector"

thanks to an update, but that is unnecessary.