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

Bless action script

SnowFox

New Member
Joined
May 18, 2008
Messages
264
Reaction score
0
I tried searching but so much threads came up i couldnt find what i was looking for and its quite simple.

If someone could please make me a script were if i used actionid xxx it will give the player all blessings for 50k i use The Forgotten Server v0.2.11pl2 (Mystic Spirit)
 
Lua:
local blessings = {1, 2, 3, 4, 5}
function onUse(cid, item, fromPos, toPos)
		if isPlayer then
			if doPlayerRemoveMoney(cid, 50000) then
				doPlayerAddBlessing(cid, blessings)
				doSendMagicEffect(getCreaturePosition(cid), CONST_MAGIC_RED)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You\'ve bought all blessings at the cost of 50000 gold")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You don\'t have enough money!")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POOF
			end
		end
	return true
end
I hope you can setup the actions.xml yourself.
 
Lua:
local blessings = {1, 2, 3, 4, 5}
function onUse(cid, item, fromPos, toPos)
		if isPlayer then
			if doPlayerRemoveMoney(cid, 50000) then
				doPlayerAddBlessing(cid, blessings)
				doSendMagicEffect(getCreaturePosition(cid), CONST_MAGIC_RED)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You\'ve bought all blessings at the cost of 50000 gold")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You don\'t have enough money!")
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POOF
			end
		end
	return true
end
I hope you can setup the actions.xml yourself.

That isn't going to work.
 
Lua:
function onUse(cid, item)
	local blesses = 0
	for i = 1, 5 do
		if(not(getPlayerBlessing(cid, i))) then
			if(doPlayerRemoveMoney(cid, 10000)) then
				doPlayerAddBlessing(cid, i)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
				blesses = blesses + 1
			end
		end
	end
	return doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, blesses and "You've bought " .. blesses .. " blesses, for total of " .. blesses * 10000 .. " gold coins." or "You haven't bought any blesses.")
end
 
Back
Top