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

Action Training Spears Selling Lever

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Reaction score
53
Location
Włocławek
Hello i made lever which selling training spears with low attack/def ; )

trainingLever.lua
PHP:
local config = {
-- script config --
cost = 5, -- cost of spear (gp)
spearID = XXXX, -- id of spear which selling
spearCount = 1, -- how many spears are selling for once cost
newName = "Training Spear", -- new spear name
newAttack = 5, -- new attack of spear
newDefence = 3 -- new defence of spear
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, config.cost) then
		local addItem = doPlayerAddItem(cid, config.spearID, config.spearCount)
		setItemName(addItem, config.newName)
		setItemAttack(addItem, config.newAttack)
		setItemDefence(addItem, config.newDefence)
		doPlayerSendTextMessage(cid, 19, "You bought "..config.spearCount.." spear(s) for "..config.cost.." gp.")
	else
		doPlayerSendCancel(cid, "Sorry, you don't have enough money.")
	end
return TRUE
end
please set all in config! : )

and in actions.xml:
PHP:
<action uniqueid="XXXX" event="script" value="trainingLever.lua"/>
set here unique id of lever.

Yours,
Azi.
 
Easy & Simple but good idea, anyway i have better idea for paladins training but i don't say :P

ofc. rep++ :)
 
Back
Top