Advertisement
Guest User

Untitled

a guest
Feb 29th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local config = {
  2.     outfits = {"rat", "green frog", "chicken"}, -- possible outfits
  3.     duration = 45, -- duration of the outfit in seconds
  4.     breakChance = 1 -- a chance of losing the wand
  5. }
  6.  
  7. function onUse(cid, item, fromPosition, itemEx, toPosition)
  8.     if(math.random(1, 100) <= config.breakChance) then
  9.         doSummonCreature("Mad Sheep", toPosition)
  10.         doRemoveItem(item.uid, 1)
  11.         return true
  12.     end
  13.  
  14.     if(isPlayer(itemEx.uid)) then
  15.         doSetMonsterOutfit(itemEx.uid, config.outfits[math.random(1, table.maxn(outfits))], config.duration * 1000)
  16.         doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
  17.     end
  18.  
  19.     return true
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement