Imfreezing
Krossa Kapitalismen
as the title says when i spawn a 425 witch is a pressed tile,its not pressed its just like the normal 426 
please help
thanks
please help
thanks
It's because 425 transforms to 426 when you stepout the tile.
there is a event called pacman where u have to press down 84 tiles idk if ure familiar with it toughIf you change that, then the tile won't be unpressed anymore at all.
What is the reason you want that it stays inpressed? If you add an other stepout script with just return true to it (with actionid/uniqueid instead of itemid), then it will stay unpressed.
function onStepOut(cid, item, position, fromPosition)
return true
end
where should i put that scipt?You can add this.
Then add it with the actionid the tiles have in movements.xml.Code:function onStepOut(cid, item, position, fromPosition) return true end
function onStepOut(cid, item, position, fromPosition)
if isInArray(decreasingItemID, item.itemid) then doTransformItem(item.uid, item.itemid - 1)
elseif item.itemid == 425 then doTransformItem(item.uid, item.itemid + 1)
end
return true
end
Pacman uses actionids on these tiles if I remember correctly, so you can add it with that actionid in movements.xml, it would be the same as the stepin line for pacman, but then with stepout.where should i put that scipt?
function onStepOut(cid, item, position, fromPosition)
return true
end
You have to add it in movements.xml with the actionid, not with the itemid.
The reason for adding this script is that tiles with that actionid will ignore the other script that transforms it, but it will still work for the tiles then without the actionid.
function onStepOut(cid, item, position, fromPosition)
return true
end
-- Pacman script: Controller [TGY]
pressedTiles = {}
gameStarted = false
dif = 1
local function pacmanCounter(text, start, col, dif)
if start then
gameStarted = true
doCreateMonster("Pacman Ghost", {x = 1246, y = 1537, z = 7})
if dif > 1 then
doCreateMonster("Pacman Ghost", {x = 1251, y = 1537, z = 7})
end
if dif > 2 then
doCreateMonster("Pacman Ghost", {x = 1256, y = 1537, z = 7})
end
end
doSendAnimatedText({x = 1251, y = 1542, z = 7}, text, col)
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if false == isPlayer(cid) then
return
end
if item.actionid == 5301 and item.itemid == 426 then
-- HANDLE TILE
if not gameStarted then
--doPlayerPopupFYI(cid, "x")
doTeleportThing(cid, fromPosition, true)
return true
end
doTransformItem(item.uid, 425)
table.insert(pressedTiles, position)
local cnt = #pressedTiles
doSendAnimatedText(position, (cnt).."/84", TEXTCOLOR_GREEN)
if cnt > 83 then
doTeleportThing(cid, {x = 1003, y = 1000, z = 7}, true)
doSendAnimatedText(position, ":D", TEXTCOLOR_GREEN)
local prize = 5
if dif == 2 then prize = 10 end
if dif == 3 then prize = 20 end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[PACMAN] You won ".. prize .." Game Tokens!")
doPlayerAddItem(cid,6527,prize)
end
elseif item.actionid == 7392 then
-- HANDLE JOINING PERSON
local c = isCreatureInArea({x = 1246, y = 1537, z = 7},{x = 1256, y = 1547, z = 7}) -- Getting crss inside
for _,v in pairs(c) do
if isPlayer(v) then
doTeleportThing(cid, fromPosition, true)
return true
end
end
-- Nobody is inside, check ticket/pick it - check exhaust first
--doPlayerPopupFYI(cid, "You must wait " .. (math.floor((getPlayerStorageValue(cid, 7948)-os.time())/60)+1) .. " more minutes till you can play again.")
if getPlayerStorageValue(cid, 7948) > 0 and (os.time() < getPlayerStorageValue(cid, 7948)) then
doTeleportThing(cid, fromPosition, true)
doPlayerPopupFYI(cid, "You must wait " .. (math.floor((getPlayerStorageValue(cid, 7948)-os.time())/60)+1) .. " more minute(s) till you can play again.")
return true
end
if getPlayerItemCount(cid, 6527) < 1 then
doTeleportThing(cid, fromPosition, true)
doPlayerPopupFYI(cid, "You need 1 Game Token to play.")
return true
end
doPlayerRemoveItem(cid, 6527, 1)
setPlayerStorageValue(cid, 7948, os.time() + 900)
-- Set difficulity variabele
dif = 1
if item.uid == 7396 then
dif = 2
elseif item.uid == 7397 then
dif = 3
end
-- Clean the area and reset the tiles now
for _,v in pairs(c) do
doRemoveCreature(v)
end
for _,v in pairs(pressedTiles) do
doItemSetAttribute(doCreateItem(426, v),"aid", 5301)
end
pressedTiles = {}
gameStarted = false
doTeleportThing(cid, {x = 1251, y = 1542, z = 7}, true)
pacmanCounter("3", false, TEXTCOLOR_RED, dif)
addEvent(pacmanCounter,1000,"2", false, TEXTCOLOR_ORANGE, dif)
addEvent(pacmanCounter,2000,"1", false, TEXTCOLOR_YELLOW, dif)
addEvent(pacmanCounter,3000,"GO!", true, TEXTCOLOR_GREEN, dif)
end
return true
end