andre66
Banned User
- Joined
- Oct 27, 2008
- Messages
- 295
- Reaction score
- 0
Well, i made up a quest with annih script. But after 10 people have done it the others can't enter. Or if they failed and wanna try again they can't use the switch. Just says sorry not possible.
Here is my script.
Here is my script.
local playerPosition =
{
{x = 1105, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1104, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1103, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1102, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1101, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1100, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1099, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1098, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1097, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1096, y = 996, z = 8, stackpos = STACKPOS_TOP_CREATURE},
}
local newPosition =
{
{x = 1101, y = 990, z = 9},
{x = 1101, y = 991, z = 9},
{x = 1101, y = 992, z = 9},
{x = 1101, y = 993, z = 9},
{x = 1101, y = 994, z = 9},
{x = 1101, y = 995, z = 9},
{x = 1101, y = 996, z = 9},
{x = 1101, y = 997, z = 9},
{x = 1101, y = 998, z = 9},
{x = 1101, y = 999, z = 9},
}
-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for i = 1, 10 do
failed = TRUE
player = getThingfromPos(playerPosition)
if player.itemid > 0 then
if isPlayer(player.uid) == TRUE then
if getPlayerStorageValue(player.uid, 30011) == -1 then
if getPlayerLevel(player.uid) >= 100 then
failed = FALSE
end
end
end
end
if failed == TRUE then
doPlayerSendCancel(cid, "Level 100 please..")
return TRUE
end
end
for i = 1, 10 do
doSendMagicEffect(playerPosition, CONST_ME_POFF)
doTeleportThing(player.uid, newPosition, FALSE)
doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return TRUE
end