Cloow
Active Member
- Joined
- May 10, 2010
- Messages
- 1,086
- Reaction score
- 35
Hello, can someone please fix my script?
When entering a tile, you get teleported to your specific storageid
I can't see what im doing wrong.
upon entering the tile, it just sends me the cancel message. No console errors.
--------------------------------------------------------------------------------
Script for getting storageids (works properly I think)
- - - Updated - - -
Like this
http://otland.net/f82/advanced-checkpoint-system-172371/
but without the dialog and opportunity to choose checkpoint, instead just teleport the player to its storageid without questions asked.
When entering a tile, you get teleported to your specific storageid
I can't see what im doing wrong.
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local config = {
{storage = 10001, position = {x=1023, y=1017, z=6}, msg = "Floor [1]"},
{storage = 10002, position = {x=1023, y=1017, z=5}, msg = "Floor [2]"},
{storage = 10003, position = {x=1023, y=1017, z=4}, msg = "Floor [3]"},
{storage = 10004, position = {x=1023, y=1017, z=3}, msg = "Floor [4]"},
{storage = 10005, position = {x=1023, y=1017, z=2}, msg = "Floor [5]"},
{storage = 10006, position = {x=1023, y=1017, z=1}, msg = "Floor [6]"},
{storage = 10007, position = {x=1023, y=1017, z=0}, msg = "Floor [7]"}
}
if getCreatureStorage(cid, config.storage) >= 1 then
doTeleportThing(cid, config.position)
doSendMagicEffect(getCreaturePosition(cid),CONST_ME_TELEPORT)
doSendMagicEffect(config.position, CONST_ME_TELEPORT)
else
doPlayerSendCancel(cid, "You can't go there right now")
end
return true
end
upon entering the tile, it just sends me the cancel message. No console errors.
--------------------------------------------------------------------------------
Script for getting storageids (works properly I think)
Lua:
function onStepIn(cid, item, position, fromPosition)
local pos = getCreaturePosition(cid)
if(isPlayer(cid) and getCreatureStorage(cid, 10002) ~= 1) then
doCreatureSetStorage(cid, 10002, 1)
doPlayerSetStorageValue(cid, 10001, -1) -- removes the storageid for the old floor
doCreatureSay(cid, "You've reached Floor [2]", TALKTYPE_MONSTER)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
return true
end
- - - Updated - - -
Like this
http://otland.net/f82/advanced-checkpoint-system-172371/
but without the dialog and opportunity to choose checkpoint, instead just teleport the player to its storageid without questions asked.