fracek91
Member
- Joined
- May 30, 2008
- Messages
- 423
- Reaction score
- 8
Hi, I've got a script that looks like this (It looks a bit messy and it's written in polish, but don't bother that, it works)
what to put instead of getgate.count to make it working? Or how to check the count in any other way?
Code:
function onUse(cid, item, frompos, item2, topos)
[some configs here]
gatepos = {x=972, y=904, z=7, stackpos=1}
getgate = getThingfromPos(gatepos)
if getgate.itemid == 9971 and [B]getgate.itemcount[/B] >=20 then
for i=1,20 do
doRemoveItem(getgate.uid,1)
end
doCreateItem(1497,1,gate2pos)
doCreateItem(1497,1,gate3pos)
if number == 1 then
executeRaid(raids[math.random(1,#raids)])
doPlayerSendTextMessage(cid, 22, "Gratulacje!Wylosowales raid")
else
doPlayerSendTextMessage(cid, 14, "Tym razem sie nie udalo. Sprobuj jeszcze raz")
end
elseif getgate.itemid ~=9971 then
doPlayerSendTextMessage(cid, 14, "Poloz sztabki zlota zeby losowac")
doRemoveItem(getgate2.uid,1)
doRemoveItem(getgate3.uid,1)
end
end
return TRUE
what to put instead of getgate.count to make it working? Or how to check the count in any other way?