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

TalkAction Aol

Eazy M

Developer
Joined
Oct 17, 2010
Messages
911
Reaction score
62
Location
.
SIMPLE Aol script.
Btw im a new scripter.

Just edit the "XXX" to the ID of aol.

Code:
function onSay(cid, words, param)

local aol = XXX --ID OF AOL

  if doPlayerRemoveMoney(cid, 40000) == true then
	doPlayerPopupFYI(cid, "You have bought a aol for 4cc")
	doPlayerAddItem(cid, aol, 1)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
  else
	doPlayerSendCancel(cid, "Sorry, You need 4cc to buy a aol.")
  end
return true
end

Comment ;)
 
Last edited:
doPlayerPopupFYI(cid, "You have bought a aol for 4cc")
should be:
doPlayerPopupFYI(cid, "You have bought an aol for 4cc")

Just correcting some grammar, it's still a nice script.
 
LUA:
local config = {
        cost = 30000, -- cost
        aol = 2193,   -- dont move
        effect = CONST_ME_MAGIC_BLUE -- effect	
}
function onSay(cid, words, param)
  if doPlayerRemoveMoney(cid, config.cost) == true then
	doPlayerPopupFYI(cid, "You have bought an "..getItemArticleById(config.aol).." for "..config.cost.." gps.")
	doPlayerAddItem(cid,config.aol, 1)
	doSendMagicEffect(getCreaturePosition(cid), config.effect)
  else
	doPlayerSendCancel(cid, "Sorry, You need "..config.cost.." gps to buy a "..getItemArticleById(config.aol)..".")
  end
return true
end
Other code by me!!
 
Last edited:
I'm also learning lua so I decided to post my version to:)
LUA:
function onSay(cid, words, param)	
	
if doPlayerRemoveMoney(cid, 40000) then
			doPlayerAddItem(cid, 2173, 1)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased an amulet of loss for 40k!")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED)
			   else
				doPlayerSendCancel(cid, "Sorry, You need 4cc to buy a aol.")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
			end
	return true
end
 
Last edited:
Nice Clinten, but you need to work on your tabbing.
Use this program to make code, it's amazing.
 
LUA:
local config = {
        cost = 30000, -- cost
        aol = 2193,   -- aol id	
        effect = CONST_ME_MAGIC_BLUE -- effect	
}
function onSay(cid, words, param)
  if doPlayerRemoveMoney(cid, config.cost) == true then
	doPlayerPopupFYI(cid, "You have bought an "..getItemArticleById(config.aol).." for "..config.cost.." gps.")
	doPlayerAddItem(cid,config.aol, 1)
	doSendMagicEffect(getCreaturePosition(cid), config.effect)
  else
	doPlayerSendCancel(cid, "Sorry, You need "..config.cost.." gps to buy a "..getItemArticleById(config.aol)..".")
  end
return true
end
Other code by me!!

Code:
        aol = 2173,   -- aol id

Litle error.
 
Back
Top