wafuboe
Active Member
- Joined
- Dec 24, 2010
- Messages
- 884
- Solutions
- 2
- Reaction score
- 26
I got this error i recently paste the goblet part from other datapack but i screwed up
i know its something about i recently added but exactly i dont know where to put it
Heres the script
i know its something about i recently added but exactly i dont know where to put it
Heres the script
Code:
local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
local maxLevel = 1000
function onStepIn(creature, item, position, fromPosition)
if not increasing[item.itemid] then
return true
end
local player = creature:getPlayer()
if player == nil or player:isInGhostMode() then
return true
end
item:transform(increasing[item.itemid])
if item.actionid >= 1000 and item.actionid - 1000 <= maxLevel then
if player:getLevel() < item.actionid - 1000 then
player:teleportTo(fromPosition, false)
position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
end
return true
end
if isInArray(GobletTiles, item.actionid) then
local gobletPos = getThingPos(item.uid)
if getPlayerStorageValue(cid, item.actionid) ~= 1 then
setPlayerStorageValue(cid, item.actionid, 1)
goblet = doCreateItemEx(Goblets[item.actionid].Id, 1)
doSetItemSpecialDescription(goblet, Goblets[item.actionid].txt.."\nAwarded to "..getCreatureName(cid)..".")
gobletPos.y = gobletPos.y - 1
doSendMagicEffect(gobletPos,CONST_ME_MAGIC_GREEN)
doTileAddItemEx(gobletPos, goblet)
end
end
return true
end
if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
local lookPosition = player:getPosition()
lookPosition:getNextPosition(player:getDirection())
local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
if depotItem ~= nil then
local depotItems = 0
for i = 1, 17 do
depotItems = depotItems + player:getDepotChest(i, true):getItemHoldingCount()
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
return true
end
return true
end
if item.actionid ~= 0 and player:getStorageValue(item.actionid) <= 0 then
player:teleportTo(fromPosition, false)
position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:sendTextMessage(MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
return true
end
return true
end
function onStepOut(creature, item, position, fromPosition)
if not decreasing[item.itemid] then
return true
end
if creature:isPlayer() and creature:isInGhostMode() then
return true
end
item:transform(decreasing[item.itemid])
return true
end