• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Floor TP for VIPs.

Alcik

ots.tibiaserver.pl
Joined
Mar 12, 2009
Messages
177
Reaction score
4
Location
Ireland/Polish
I didn't see it here so I decided to put it here.

This is script for VIP system. The tile that has unique id 30001 will teleport players with VIP to VIP area and players without VIP to temple.
I'm new in scrips in LUA, and in scripts at all so I hope there is no mistakes.

Add this to movements.xml
Lua:
<movevent type="StepIn" uniqueid="30001" event="script" value="viptp.lua"/>


And add this to /data/movements/scripts/viptp.lua
Lua:
--Simple script by AlcikOTS. I'am new in this things so sorry if I make any mistakes.

function onStepIn(cid, item, frompos, item2, topos)

    local vip = getPlayerStorageValue(cid,11551) >= 1 --Vip Storage.
    local back = {x=1000, y=1000, z=7} --Place where non vip is teleported.
        local allowed = {x=1216, y=1038, z=7} --Place where VIPs are teleported.


    if(vip) then
        doPlayerSendTextMessage(cid, 19, "You are VIP so you are allowed to pass.")
                doSendMagicEffect(getPlayerPosition(cid),2) 
                doTeleportThing(cid, allowed) 
                doSendMagicEffect(allowed,10)
    else
        doPlayerSendTextMessage(cid, 19, "You can't pass because you don't have Vip! You can get it in our SMS Shop.")
                doTeleportThing(cid, back)
    end
end

I know thats its simple script but maybe someone will like it.

Script 100% by me!
 
Fixed Version
Lua:
	 local config = {
	 vip = getPlayerStorageValue(cid,11551) --Vip storage, If you use another vip sytem change this to 'getPlayerVipDays(cid)'
	 newpos = {x=1216, y=1038, z=7} --New position
	 lol = getPlayerPosition(cid)
	 }
	 function onStepIn(cid, item, frompos, item2, topos)
    if config.vip >=1 then
		doCreatureSay(cid, "Welcome Vip player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(config.lol,2) 
                doTeleportThing(cid,config.newpos) 
                doSendMagicEffect(config.newpos,10)
    else
            doPlayerSendCancel(cid, "Only VIP players can pass.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(config.lol, CONST_ME_POFF)
    end
	return true
end
 
[24/08/2010 23:26:38] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tp.lua:3: '}' expected (to close '{' at line 1) near 'newpos'
[24/08/2010 23:26:38] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tp.lua)
[24/08/2010 23:26:38] data/movements/scripts/tp.lua:3: '}' expected (to close '{' at line 1) near 'newpos'
 
Back
Top