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

Disabling a spell to team members for a certain time?

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Disabling a spell to team members for a certain time? <- Could this be possible, via a command?
 
A spell like Exevo Gran Mas Flam? if so then:
LUA:
local t = {
	['exevo gran mas vis'] = 1239, --spell name or spell words and empty storage
	['exevo gran mas frigo'] = 3213, --spell name or spell words and empty storage
	['exura'] = 1234 --spell name or spell words and empty storage
}
function onSay(cid, words, param, channel)
local k = string.explode(param, ',')
local v = t[k[2]]
local i = {}
	if param == '' then
		return doPlayerSendTextMessage(cid, 27, 'Command param required') and false
	end
	if not k[2] then
		return doPlayerSendTextMessage(cid, 27, 'Second command param required') and false
	end
	if not k[3] then
		return doPlayerSendTextMessage(cid, 27, 'Third command param required') and false
	end
	if not tonumber(k[3]) then
		return doPlayerSendTextMessage(cid, 27, 'Third command param must be a number') and false
	end
	if not v then
		return doPlayerSendTextMessage(cid, 27, 'This spell is not in the list') and false
	end
	for _, pid in ipairs(getPlayersOnline()) do
		if getPlayerGuildName(pid) == k[1] then
			table.insert(i, getPlayerName(pid))
		end
	end
	if #i > 0 then
		for _, pid in ipairs(getPlayerOnline()) do
			if isInArray(i, getPlayerName(pid)) then
				exhaust.set(pid, v, k[3]*1000)
			end
		end
	else
		doPlayerSendTextMessage(cid, 27, k[1]..'\'s guild members not foud')
	end
i = {}
return TRUE
end
and then add this to the spell after "function onCastSpell(cid, var)"
LUA:
if exhaustion.get(cid, 1239) then
	return doPlayerSendCancel(cid, 'You are exhausted') and doSendMagicEffect(getPlayerPosition(cid), 2) and false
end
Note that you have to edit the storage in exhaustion.get to the storage you stated in the command config.
/exhaust Mtibia legends, exura, 60
It will not allow the online members of "mtibia legends" to cast exura for 60 seconds

Also, thread moving to the requests board.
 
Last edited:
Back
Top