• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help change script

dervin13

Active Member
Joined
Apr 26, 2008
Messages
459
Solutions
1
Reaction score
28
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
       
        if getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45) then
                doPlayerAddItem(cid, 2160, 5)
                setPlayerStorageValue(cid, 99963, 1)
                doPlayerSendTextMessage(cid, 22, "You have received 5 crystal coins because you reached level 45")
                end
        return TRUE
end

Someone know how to change i want one script that when player get level X, he will be teleported to one place...
tyy
 
LUA:
local loc = {x = 100, y = 100, z = 7}-- TP to!
local lvl = 65-- Put the level to teleport!
function onAdvance(cid, skill, oldlevel, newlevel)
        if(skill == SKILL__LEVEL and newlevel >= lvl and oldLevel < lvl) then
			doTeleportThing(cid, loc)
			doPlayerSendTextMessage(cid, 22, "You have been teleported because you reached level " .. lvl .. "!")
        end
        return true
end

Here you go.. i deleted the storage since its not needed, rep++ if it works :ninja:

Yes im a repwhore ;) xD
 
What error are you getting > Or is the script Just plain not working ^^ if there's an error please describe it and a bit more description of the problem would be nice :D

if you actually read, you'll know his problem and you'll know that Milice already gave him the script that he requested.
 
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
position = {x=32360, y=31782, z=7}
lvl = 200
local config = {savePlayersOnAdvance = true}
if(config.savePlayersOnAdvance) and newlevel >= lvl then
doTeleportThing(cid,position)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You get teleported to DP because you reach the necessary level")
end
return TRUE
end

You can edit/remove this text.
LUA:
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You get teleported to DP because you reach the necessary level")




Please guys, help here
http://otland.net/f132/npc-buffer-why-dont-works-131214/#post1272208
 
Code:
local pos = {x=100, y=100, z=7}

function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL and newLevel >= 45 and getPlayerStorageValue(cid, 111) == -1 then
		doCreatureSetStorage(cid, 111, 1)
		doTeleportThing(cid, pos)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doCreatureSay(cid, 'You have been teleported because you reached level 45.', TALKTYPE_ORANGE_1)
	end
	return true
end
storage is required or you get teleported again on any level higher
 
Code:
local pos = {x=100, y=100, z=7}

function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL and newLevel >= 45 and getPlayerStorageValue(cid, 111) == -1 then
		doCreatureSetStorage(cid, 111, 1)
		doTeleportThing(cid, pos)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doCreatureSay(cid, 'You have been teleported because you reached level 45.', TALKTYPE_ORANGE_1)
	end
	return true
end
storage is required or you get teleported again on any level higher

OMG Cykotitan failed :D

if(skill == SKILL__LEVEL and newlevel >= lvl and oldLevel < lvl) then

if oldLevel is under ^^ no storage needed ;)
 
Back
Top