Solorn Moveryx
New Member
- Joined
- Mar 18, 2009
- Messages
- 10
- Reaction score
- 1
So i was searching for a script about a player getting teleported to a place when reach lvl 10 and found out
but when the player gets lvl 11,12 etc it is still teleported and not only lvl 10 so i tried to add a storage value but now it doesnt works.
I need someone to help me to find out what is wrong.
thanks.
Lua:
local config =
{
pos = {x = 974, y = 831, z = 7},
message = "You have raised your 10 Level. Teleport!",
levelToTeleport = 10,
skill = 8 -- 8 = level
}
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == config.skill and newlevel >= config.levelToTeleport then
doPlayerSendTextMessage(cid,TALKTYPE_BROADCAST, config.message)
doTeleportThing(cid, config.pos)
end
return TRUE
end
but when the player gets lvl 11,12 etc it is still teleported and not only lvl 10 so i tried to add a storage value but now it doesnt works.
Lua:
local config =
{
pos = {x = 974, y = 831, z = 7},
message = "You have raised your 10 Level. Teleport!",
levelToTeleport = 10,
skill = 8 -- 8 = level
}
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == config.skill and newlevel >= config.levelToTeleport and if getPlayerStorageValue(cid, 14722) == 0 then
doPlayerSendTextMessage(cid,TALKTYPE_BROADCAST, config.message)
doTeleportThing(cid, config.pos)
setPlayerStorageValue(cid, 14722, 1)
end
return TRUE
end
end
I need someone to help me to find out what is wrong.
thanks.