Functions

Shared functions for both server-side and client-side.

getCore

-- get iCore
local iCore = exports.iCore:getCore()

shared.functions.round

Round number with decimals.

-- 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

Count the table then return total index.

local iCore = exports.iCore:getCore()
local count = iCore.shared.functions.countTable({'1','2','5'})
print(count)
-- result will be: 3

shared.functions.isValueInTable

Check value in table and return true or false.

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