Exports

Client

OpenMenu() - Opens the main metal detecting menu

exports.lation_detecting:OpenMenu()

GetPlayerData(type) - Get all or some of players latest data

local data = exports.lation_detecting:GetPlayerData()
print(data.level) -- Level
print(data.experience) -- Experience
print(data.items_found) -- Total items found
print(data.money_earned) -- Total money earned

-- If only looking for a specific data type, can also be used like so:
local playerLevel = exports.lation_detecting:GetData('level')
print('Player is currently level: ' ..playerLevel)

Server

GetPlayerData(source, type) - Get all or some of players latest data

-- source: Player ID
-- type: Data type (optional)
local data = exports.lation_detecting:GetPlayerData(source)
print(data.level) -- Level
print(data.experience) -- Experience
print(data.items_found) -- Total items found
print(data.money_earned) -- Total money earned

-- If only looking for a specific data type, can also be used like so:
local playerLevel = exports.lation_detecting:GetData(source, 'level')
print('Player is currently level: ' ..playerLevel)

AddPlayerData(source, type, amount) - Add new data to player

-- source: Player ID
-- type: Data type to add ('experience', 'items_found', 'money_earned')
-- amount: Amount (number) to add
exports.lation_detecting:AddPlayerData(source, 'experience', 100)
-- Adds 100XP to players experience

Last updated