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

mounts from chest

Quickshot

Member
Joined
Nov 8, 2008
Messages
595
Reaction score
8
hey i have a small problem with one of my scripts. when you have no mounts and you use the chest its works fine, but if you have all the mounts and use the chest you get bugged plz help

heres the script
LUA:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 12345 then
queststatus = getPlayerStorageValue(cid,368)
if queststatus == -1 or queststatus == 0 then
doPlayerSendTextMessage(cid,19,"Now you have all mounts")
for i = 1, 12 do     
doPlayerAddMount(cid, i)
end
setPlayerStorageValue(cid,368,1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end
end
return true
end
 
Last edited:
cid,25 --- NO EXIST (8.61+)
Try,,
Code:
doPlayerSendTextMessage[COLOR=#66CC66]([/COLOR]cid,[COLOR=#CC66CC] MESSAGE_EVENT_ADVANCE[/COLOR],[COLOR=#FF0000] "Now you have all mounts"[/COLOR][COLOR=#66CC66])
[/COLOR]doPlayerSendTextMessage[COLOR=#66CC66]([/COLOR]cid,[COLOR=#CC66CC] MESSAGE_INFO_DESCR[/COLOR],[COLOR=#FF0000] "The chest is empty."[/COLOR][COLOR=#66CC66])[/COLOR]
 
Last edited:
Try This one, not tested tho:
LUA:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 12345 then
     queststatus = getPlayerStorageValue(cid, 368)
	else
        if queststatus == -1 or queststatus == 0 then
            doPlayerSendTextMessage(cid,19,"Now you have all mounts")
        for i = 1, 12 do     
            doPlayerAddMount(cid, i)
            setPlayerStorageValue(cid,368,1)
        else
            doPlayerSendCancel(cid, "You already claimed your mounts!")
	end	
    end    
    return true
end
 
Last edited:
I guess that's for the mounts ur gonna get? Can't I just make so, i recive 1 mount.

So.. ?

No loop needed for only 1 mount
LUA:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 12345 then
     queststatus = getPlayerStorageValue(cid, 368)
	else
        if queststatus == -1 or queststatus == 0 then
            doPlayerSendTextMessage(cid,19,"Now you have all mounts")     
            doPlayerAddMount(cid, 1) ----- see :D
            setPlayerStorageValue(cid,368,1)
        else
            doPlayerSendCancel(cid, "You already claimed your mounts!")
	end	
    end    
    return true
end
 
Back
Top