WARNING: SaveCJ\Script.lua:33: Bad argument @ 'split' [Expected string at argument 1, got boolean]
WARNING: SaveCJ\Script.lua:34: Bad argument @ 'split' [Expected string at argument 1, got boolean]
ERROR: SaveCJ\Script.lua:36: attempt to index local 'textures' (a number value)
function setClothes()
local account = getPlayerAccount(source)
if ( not isGuestAccount(account) ) then
local textureString = getAccountData(account, "Clothessaver:Texture")
local modelString = getAccountData(account, "Clothessaver:Model")
local textures = split (textureString, 44) ---- line 33
local models = split (modelString, 44) ---- line 34
for i=0, 17, 1 do
if ( textures[i+1] ~= "," or textures[i+1] ~= nil )
then addPedClothes(source, textures[i+1], models[i+1], i) ---- line 36
end
end
outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0)
textures = {}
models = {}
end
end
addEventHandler("onPlayerLogin", getRootElement(), setClothes)