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

Action Bird Cage

Wifixs

New Member
Joined
Jul 20, 2009
Messages
18
Reaction score
1
Chorajk and Mazen Help me Thanks guys.

When using the item (bird cage) sends different effects


Tested in tfs v.2

Lua:
<action itemid="2095" script="BirdCage.lua"/>

Lua:
effects = {
        CONST_ME_SOUND_BLUE,
        CONST_ME_SOUND_RED,
        CONST_ME_SOUND_YELLOW,
        CONST_ME_SOUND_PURPLE,
        CONST_ME_SOUND_BLUE,
        CONST_ME_SOUND_WHITE
}
 
function onUse(cid, item, frompos, item2, topos )
        doSendMagicEffect(frompos, effects[math.random(1, #effects)])
        return true
end


And for v.3 in global events

each 30 seg sends the different types from effects

Lua:
<globalevent name=" Bird Cage " interval="30" event="script" value="Bird Cage.lua"/>

Lua:
function onThink(cid, interval, lastExecution)
	local config = {
		cage_id = 2095,
		effects = {CONST_ME_SOUND_BLUE, CONST_ME_SOUND_YELLOW, 
CONST_ME_SOUND_GREEN, 
CONST_ME_SOUND_WHITE}
	}
 
for i, tid in ipairs(getPlayersOnline()) do
	if (getPlayerItemCount(tid, config.cage_id) >= 1) then
doSendMagicEffect(getCreaturePosition(tid), config.effects[math.random(1, #config.effects)])
		end
	end
 
	return TRUE
end
 
Back
Top