Cloow
Active Member
- Joined
- May 10, 2010
- Messages
- 1,086
- Reaction score
- 35
I have no idea if this is even possible, i've been testing some stuff but cant get it to work.
Anyway, when a player enter a certain tile the player will get teleported to the storage id it has.
This is the one I need help with, I guess "checkpoint) then" is where it gets the error
-----------------------------------------------------------------------------------
This will remove floor 1 storage
Anyway, when a player enter a certain tile the player will get teleported to the storage id it has.
This is the one I need help with, I guess "checkpoint) then" is where it gets the error
Lua:
local CHECKPOINT_TELEPORT = {
[10001] = pos = {x = 1023, y = 1017, z = 6, stackpos = 1}},
[10002] = pos = {x = 1023, y = 1017, z = 5, stackpos = 1}}
}
function onStepIn(cid, item, position, fromPosition)
local checkpoint = CHECKPOINT_TELEPORT
if(isPlayer(cid) and getCreatureStorage(cid, checkpoint) then
doTeleportThing(cid, checkpoint.pos, false, true)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(checkpoint.pos, CONST_ME_TELEPORT)
end
return false
end
Lua:
function onStepIn(cid, item, position, fromPosition)
local pos = getCreaturePosition(cid)
if(isPlayer(cid) and getCreatureStorage(cid, 10001, < 1) then
doCreatureSetStorage(cid, 10001, 1)
doCreatureSay(cid, "You've reached Floor [1]", TALKTYPE_MONSTER)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
else
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
return true
end
This will remove floor 1 storage
Lua:
function onStepIn(cid, item, position, fromPosition)
local pos = getCreaturePosition(cid)
if(isPlayer(cid) and getCreatureStorage(cid, 10002, < 1) then
doCreatureSetStorage(cid, 10002, 1)
doSetStorage(10001, -1)
doCreatureSay(cid, "You've reached Floor [2]", TALKTYPE_MONSTER)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
else
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
return true
end
Last edited: