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

No idea what is wrong :P

revion

New Member
Joined
Oct 27, 2009
Messages
46
Reaction score
0
Hello!
I made a script, which should do such things:
when someone clicks on an item (stone), then it checks one's storage if it is not 8888.
Then it should summon monsters on pos1-pos4, set player's storage to 8888 (so one couldn't do this action again), and give him a plate armor.
BUT when I click on a stone, then nothing happens :/ (there's not 'Sorry not possible' too)
Could anyone tell me what's wrong with it? :P
Code:
function onUse(cid, item, frompos, item2, topos)
if(getPlayerStorageValue ~= 8888) then
pos1 = {x=1100, y=924, z=8}
pos2 = {x=1113, y=925, z=8}
pos3 = {x=1100, y=925, z=8}
pos4 = {x=1113, y=925, z=8}
if item.itemuid == 8888 then
setPlayerStorageValue(cid, 8888)
doSummonCreature("rotworm", pos1)
doSummonCreature("rotworm", pos2)
doSummonCreature("carrion worm", pos3)
doSummonCreature("carrion worm", pos4)
doCreatureSay(cid, "Oh, why did I touch this stone?!")
doPlayerAddItem(cid, 2647, 1)
end
return 1
else
return 0
end
end
 
Last edited:
Rewrote the script a bit to look a bit better, also this should work just fine :ninja:
LUA:
local cfg = {
pos1 = {x=1100, y=924, z=8},
pos2 = {x=1113, y=925, z=8},
pos3 = {x=1100, y=925, z=8},
pos4 = {x=1113, y=925, z=8}
}
		
function onUse(cid, item, frompos, item2, topos)
	if(getPlayerStorageValue(cid, 8888) > 0) then
		return true
	end
	
	if(item.uid == 8888) then
		setPlayerStorageValue(cid, 8888, 1)
		doSummonCreature("rotworm", cfg.pos1)
		doSummonCreature("rotworm", cfg.pos2)
		doSummonCreature("carrion worm", cfg.pos3)
		doSummonCreature("carrion worm", cfg.pos4)
		doCreatureSay(cid, "Oh, why did I touch this stone?!", TALKTYPE_ORANGE_1)
		doPlayerAddItem(cid, 2647, 1)
	end

return true
end
 
Last edited:
Back
Top