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

Random Mount Box

High Timez

Novacane
Joined
Mar 17, 2013
Messages
105
Reaction score
3
So I want to create a script that gives people a random mount when they use a present box, I will then set the box to be dropped by monsters then when they use it it says "Congratulations!"
 
I don't have any client besides 8.60 so I can't test it... but this should work.

PHP:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
    local mountid = math.random(1,32) -- you have to change 32 for your highest mount id
    doPlayerAddMount(cid, mountid) --add the mount
    doPlayerSendTextMessage(cid, 18, "Congratulations!") --message in console (red)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED) --effect on player
	doRemoveItem(item.uid, 1) -- remove the item
    return TRUE
end

@EDIT: Forgot to remove the item after use it.
 
Last edited:
I don't have any client besides 8.60 so I can't test it... but this should work.

PHP:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
    local mountid = math.random(1,32) -- you have to change 32 for your highest mount id
    doPlayerAddMount(cid, mountid) --add the mount
    doPlayerSendTextMessage(cid, 18, "Congratulations!") --message in console (red)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_RED) --effect on player
	doRemoveItem(item.uid, 1) -- remove the item
    return TRUE
end

@EDIT: Forgot to remove the item after use it.

So this will be an action?
 
Back
Top