Nesesit The Next Script
Buy Items
The Items Buy Save In Inventory Menu
Pliz!
Scripts
Save Items In Inventory
Save Items In Inventory
1

KenGar07: I'll tell you why. Becouse I was lua newbie and that script was sh*t.
KenGar07: Ok, fine.
Re: Save Items In Inventory
Avo: Well, you are still newbie?for i=1,32 do
	inventory[i]=""
end
addhook("leave","por_favor")
function por_favor(id)
	if player(id,"usgn")~=0 then
		local file=io.open("sys/lua/"..player(id,"usgn")..".txt","w")
		local str=""
		for _,weapon in pairs(playerweapons(id)) do
			str=str..weapon..","
		end
		file:write(string.sub(str,1,#str-1))
		file:close()
	end
end
addhook("join","lolnado")
function lolnado(id)
	if player(id,"usgn")~=0 then
		local file=io.open("sys/lua/"..player(id,"usgn")..".txt","r")
		if file==nil then
			file:close()
			local file=io.open("sys/lua/chars/"..player(id,"usgn")..".txt","w")
			file:write("")
			file:close()
		else
			inventory[id]=file:read("*all")
			file:close()
		end
	end
end
addhook("spawn","le_crzy_code")
function le_crzy_code(id)
	if inventory[id]~="" then
		timer(1000,"amazing_timer",tostring(id))
		return inventory[id]
	end
end
function amazing_timer(id)
	inventory[tonumber(id)]=""
end
1
