• 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!

SQM From x lvl

Krzkru

New Member
Joined
Jan 10, 2013
Messages
89
Reaction score
1
Location
Poland
I need script to make some sqms for higher lvls [ex: only 300 lvl may pass] . This is something like experience gate.

sqm.gif
 
moveevents.xml
XML:
<movevent type="StepIn" uniqueid="13377" event="script" value="sqmlvl.lua"/>
scripts/sqmlvl.lua
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local level = 300
	if (isPlayer(cid) and getPlayerLevel(cid) >= level)
		return true 
	else 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only level " .. level .. " can pass.")
		doTeleportThing(cid, fromPosition, true)
	return true
	end
end
And add in map editor unique id 13377 to every sqm you want to make to do the same.
Didn't test it so if you got any errors tell me :d
 
In movements/scripts create back.lua
Code:
function onStepIn(cid, item, position, fromPosition)
local levelreq = 300 -- Set required level here
local acid = 16161 -- Set action id of eletric sparks
local level = getPlayerLevel(cid)

        if item.aid == acid and level < levelreq then
                doTeleportThing(cid, fromPosition)
                 doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You need level " .. levelreq .. "  to pass.")
        else
                return true
        end
end

and add this to movements.xml
Code:
<movevent event="StepIn" fromid="5068" toid="5070" script="back.lua"/>

It works for electric sparks with id 5068,5069,5070 and with action id set in script (16161 in example)
 
none of them works...
arheon:
error ... : 'then' expected near 'return'

read the error, THEN EXPECTED NEAR RETURN

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local level = 300
	if (isPlayer(cid) and getPlayerLevel(cid) >= level)then
		return true 
	else 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only level " .. level .. " can pass.")
		doTeleportThing(cid, fromPosition, true)
	return true
	end
end
 
Here:

Lua:
function onStepIn(cid, item, position, fromPosition)
local level = 300
	if getPlayerLevel(cid) >= level  then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome over.")
	else
		doTeleportThing(cid, fromPosition)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be at least level "..level.." to pass here!")
		doSendMagicEffect(getPlayerPosition(cid), 9)
		end
	return TRUE
end

And put this line in movements.xml

Lua:
<movevent type="StepIn" actionid="1829" event="script" value="filename.lua"/>

And then, put this action id "1829" on the ground there lvl 300- cant pass
 
Back
Top