Functions
Shared functions for both server-side and client-side.
getCore
-- get iCore
local iCore = exports.iCore:getCore()
shared.functions.round
-- get iCore
local iCore = exports.iCore:getCore()
-- then use it
local round = iCore.shared.functions.round(2.53333, 1)
print(round)
-- result will be: 2.5
shared.functions.countTable
local iCore = exports.iCore:getCore()
local count = iCore.shared.functions.countTable({'1','2','5'})
print(count)
-- result will be: 3
shared.functions.isValueInTable
local iCore = exports.iCore:getCore()
if iCore.shared.functions.isValueInTable('1', {'1','2','5'}) then
print('1 is in table')
else
print('1 is not in table')
end
-- result will be: 1 is in table
Last updated