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

!buypremium with tokens

Ward_214

Pro PvP
Joined
Dec 11, 2008
Messages
297
Reaction score
0
I need a script to get premium with tokens.
I have "!buypremium" script now that gives x amount of days and takes x amount of gold. But I need a script that takes tokens(ID: 6527)
 
Im not sure this will work, never tried making this script before, but instead of
LUA:
if doPlayerRemoveMoney (cid, 10,000) == True then
try
LUA:
if doPlayerRemoveItem(GetItem.uid, 10000) == TRUE then
and before that put this
LUA:
if item.itemid == 6527 then
 
It wont work..

Here is my script:

Code:
 <?xml version="1.0" encoding="UTF-8"?>
<mod name="Buy premium command" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="buypremium_config"><![CDATA[
		config = {
			days = 90,
			cost = 10000,
			maxDays = 360
		}
	]]></config>
	<talkaction words="!buypremium; !pacc" event="buffer"><![CDATA[
		domodlib('buypremium_config')
		if(getPlayerPremiumDays(cid) > config.maxDays) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			return
		end

		if(not doPlayerRemoveMoney(cid, config.cost)) then
			doPlayerSendCancel(cid, "You don't have enough money, " .. config.days .. " days premium account costs " .. config.cost .. " gold coins.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			return
		end

		doPlayerAddPremiumDays(cid, config.days)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
	]]></talkaction>
</mod>
 

Similar threads

Back
Top