• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Chest Lags.

Wifebeater

New Member
Joined
Feb 24, 2011
Messages
60
Reaction score
1
Hi, i have 8.54 server . When i have the server on for a few hours

My chests lag, When you press on them,. and get an item. The whole server lags for like 0,5 seconds. and then it's back again,

rly annoying, I get this error in console

Code:
[26/04/2011 22:30:11] [Error - Action Interface] 
[26/04/2011 22:30:11] data/actions/scripts/startitem/coin.lua:onUse
[26/04/2011 22:30:11] Description: 
[26/04/2011 22:30:11] (luaDoAddContainerItem) Container not found

here someone pressed on a chest to get Gold coins. And there's several errors like this depending on what chest he presses on and all errors are the same.



here's the coin.lua script . I've used same script for all chests in game.

HTML:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 1043) < 1 then
        local bp = doPlayerAddItem(cid, 2160, 5)
		doAddContainerItem(bp, 2152, 100)
		doAddContainerItem(bp, 2273, 10)
		doAddContainerItem(bp, 2268, 10)
		doAddContainerItem(bp, 2313, 30)
		doAddContainerItem(bp, 2311, 50)
        setPlayerStorageValue(cid, 1043, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found 5 Crystal coins.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
return TRUE
end

Help me, why does it lag when u press on the chest and get an item?


BTW, The lag does not appear if the chest is empty. it only lags when you get an item
 
LUA:
local bp = doPlayerAddItem(cid, 2160, 5)

That's not an container man. :|



LUA:
function onUse(cid, item, frompos, item2, topos)

	if getPlayerStorageValue(cid,1043) == -1 then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found 5 Crystal Coins.")
		container = doPlayerAddItem(cid, 1988, 5)
			doAddContainerItem(container, 2152, 100)
				doAddContainerItem(container, 2273, 10)
					doAddContainerItem(container, 2268, 10)
				doAddContainerItem(container, 2313, 30)
			doAddContainerItem(container, 2311, 50)
		doSendMagicEffect(topos, 5)
	setPlayerStorageValue(cid, 1043, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This chest is empty.")
	end

return TRUE
end
 
thx for the script, But it doesnt work. It spawns me POI stuff. :S And i dont want a bag to come with. I ONLY want 5cc on a working script :S
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 1043) < 1 then
	doPlayerAddItem(cid, CRYSTALCOINID, 5)
        setPlayerStorageValue(cid, 1043, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found 5 Crystal coins.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
return TRUE
end
 
Back
Top