• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua When Premmy ACC finish

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
premium account when finished, go to town 8,and no with addons.

Like Real.
 
Create a file called premmy_over.lua in creaturescripts / scripts with this content:

Code:
onLogin function (cid)
        isPremium if (cid) then
else
	doTeleportThing(cid,getPlayerMasterPos(cid))
	doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You got teleported to temple, as your premium has expired.')
	doSendMagicEffect(getThingPos(cid),CONST_ME_TELEPORT)
end

And creaturescripts / creaturescripts.xml add this line:

Code:
<event type="login" name="PremmyOver" script="premmy_over.lua">

I suppose you're working with the system of common Premmium Account, if using a VIP system that works with storage let us know as it needs to change.

As for addons, I imagine that players free accounts have no addons.
 
Just add this one at top of your login.lua below function onLogin

LUA:
if isPremium(cid) then
		setPlayerStorageValue(cid, 100, 1)
	elseif getPlayerStorageValue(cid, 100) == 1 then
		doTeleportThing(cid, getTownTemplePosition(1))
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Your premium time expired.')
	end

You can make it teleport to town with id 1 with this function:
doTeleportThing(cid, getTownTemplePosition(1))

or to a specific position:
doTeleportThing(cid, {x=100,y=100,z=7})
 
Back
Top