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

[MODS] Create Portal with players limit!

soul4soul

Intermediate OT User
Joined
Aug 13, 2007
Messages
1,875
Solutions
3
Reaction score
128
Location
USA
its just an update of this code so it works with 0.3.6TFS. all you have to do in order for it to work is copy it into the mods folder. its that simple
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Portal" version="2.0" enabled="yes">
    <description>
        ---makes a portal to a location for a specified number of people
        ex. !portal x,y,z,amountofpeople
    </description>
<talkaction words="!portal" access="5" event="script"><![CDATA[
function onSay(cid, words, param)
    param = param.explode(param, ',')
    if param then
        teleport = doCreateTeleport(1387, {x=param[1], y=param[2], z=param[3]}, getPlayerPosition(cid))
        doItemSetAttribute(teleport, "description", 'The portal may enter '..param[4]..' people left.')
        doItemSetAttribute(teleport, "aid", 100+param[4])
    else
        doPlayerSendCancel(cid, "You must set param.")
    end
    return TRUE
end  
]]></talkaction>
<movement type="StepIn" itemid="1387" event="script"><![CDATA[
function onStepIn(cid, item, position, fromPosition)
    if item.actionid > 100 then
        doItemSetAttribute(item.uid, "description", 'The portal may enter '..(item.actionid-101)..' people left.')
        doItemSetAttribute(item.uid, "aid", item.actionid-1)
    elseif item.actionid == 100 then
        doBroadcastMessage("The Portal has ran out of energy and collapsed.", MESSAGE_EVENT_ADVANCE) 
        doSendMagicEffect(position, 2)
        doRemoveItem(item.uid, 1)
    end
    return true
end
]]></movement>
</mod>
 
Last edited:
it works. also if u just leave off the last parm the portal will last forever. you will get a 1time error in your console but w/e thats fine. if u use it as intend with the proper params there r no errors
 
line 10
set it like this
Code:
if param[1] ~= nil and param[2] ~= nil and param[3] ~= nil and param[4] ~= nil then
I think that should work, if there is any params missing then it will send the cancel.
 
How i can edit this, for only creat portal for X places..

For exemple.. !portal temple, 10 players... or !portal depot, 20 players..
 
Back
Top