Zombiegod
Active Member
- Joined
- Oct 22, 2009
- Messages
- 198
- Solutions
- 1
- Reaction score
- 25
so i making this item that give a random mount on use every 24 hours, but im having the issue that each time you use the item, the server needs to be reloaded to get a different mount, and everyone gets the same mount when used
also on a side note any got a script that has personalized items in it (aka if im the first person to use a rune, it locks to me and no one can use it but me
Edit whoops forgot the script
also on a side note any got a script that has personalized items in it (aka if im the first person to use a rune, it locks to me and no one can use it but me
Edit whoops forgot the script
Code:
local rand = math.random(42)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daily = getPlayerStorageValue(cid, 13541)
local daysvalue = 60
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
doPlayerAddMount(cid, rand)
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 13541, daily+1)
local daily = getPlayerStorageValue(cid, 13541)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. daily .. " Daily Mount. Enjoy.")
elseif (daily == 42) then
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You recived all possible mounts")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily mount. Next available mount will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
Last edited: