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

Vip teleport scroll help

Fu Manchu

Sepultra™
Joined
Jan 28, 2011
Messages
439
Reaction score
9
I'm trying to do stuff by hand.. not sure what is missing here. Can any one help? thx..

Vipscroll.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local newPos = {x = 513, y = 810, z = 4}
		 
		if getPlayerVipDays(cid) > 1 then
		    doTeleportThing (cid, newPos)
	    else	 
		    doPlayerSendCancel(cid, "Sorry you are not vip.")
	end
   return true
end

I also tried
[lUA]local newPos = {x = 513, y = 810, z = 4}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 0 then
doPlayerSendCancel(cid, "Sorry you are not vip.")
return 0
else
doTeleportThing (cid, newPos)
end
return 1
end[/code]

Actions.xml
XML:
<action itemid="2112" event="script" value="Vipscroll.lua"/>

What Am i missing?
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local newPos = {x = 513, y = 810, z = 4}
 
		if getPlayerVipDays(cid) > 0 then
		    doTeleportThing (cid, newPos)
	    else	 
		    doPlayerSendCancel(cid, "Sorry you are not vip.")
	end
   return true
end
 
Did not work. Not getting any errors but still did not work.

Edit: btw
Lua:
if getPlayerVipDays(cid) > 0 then
= no vip

Lua:
if getPlayerVipDays(cid) > 1 then
= vip
 
this script work good in my server and if u make > 1 so any one from player if have 1 vip will not Teleport


so u have problem with ur vip function
 
No I figured it out lmao.. I had my coords wrong.. so it was trying to tp to like no where.. ty tho ill rep for the help also my first script works perfect as well feel free to use it anybody
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local newPos = {x = 513, y = 810, z = 4}
if getPlayerVipDays(cid) <= 0 then
return doPlayerSendCancel(cid, "Sorry you are not vip.") 
end
return doTeleportThing (cid, newPos)
end
 
I ended up with this guys. Use it if you need it.

Lua:
function onUse(cid, item, frompos, item2, topos)
	local telepos = {x=513, y=844, z=7}
		
		if isPlayerPzLocked(cid) or (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
			doPlayerSendCancel(cid,"You can not teleport while in combat.")
			doSendMagicEffect(getPlayerPosition(cid),2)
		elseif getPlayerVipDays(cid) > 1 then
			doTeleportThing(cid, telepos, TRUE)
		else
			doPlayerSendCancel(cid,"You are not vip.")
	end
	return true
end
 
Last edited:
Back
Top