Runtime variables
LuaAuth provides some runtime variables which gives you access to user information
la_is_premium
Boolean
This will be True if the user is whitelisted (has a key)
and False if the user isnt whitelisted (FFA user)
This variable is only useful in FFA scripts as for non FFA scripts this variable will be True for every user
Example code
if la_is_premium then
print('user is whitelisted')
else
print('this user is not whitelisted')
end
la_executions
Integer
The total executions for the user
Works with FFA users but may be innacurate
Example code
print('this user has executed the script ' .. la_executions .. ' times')
la_discord_id
String
Nullable
The users discord_id
Will be Null for FFA users
Example code
print('the users discord id is ' .. la_discord_id)
la_seconds_left
Integer
Nullable
Seconds left until the users key expires
Will be Null for FFA users and users that key doesnt expire
Is updated every second to reflect the new value.
Example code
while true do
print('the users key will expire in ' .. la_seconds_left .. 's')
task.wait(1)
end
la_user_note
String
Nullable
The users note
Will be Null for FFA users
Example code
print('user was whitelisted for ' .. la_user_note)
if la_user_note == 'Developer' then
load_developer_Features()
end
la_script_name
String
The scripts name
Example code
print('the current script is ' .. la_script_name)
la_exists
Boolean
Returns True if your running the script through LuaAuth.
we allow you to modify LuaAuth variables inside if statements that check if la_exists is false
Example code
print('is dev: ' .. la_exists)
if not la_exists then -- best way to modify LuaAuth variables for development
la_discord_id = 01234567890123456
end
la_supports_sessions
Boolean
Returns True if the users executor supports sessions
Example code
print('is dev: ' .. la_exists)
if not la_supports_sessions then
print('sessions unsupported, no commands available')
end
la_is_ad_key
Boolean
Returns True if the users key is from the ad system
Example code
if not la_is_ad_key then
print('loading premium script...')
else
print('loading free script...')
end