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

Lua Revive script- Pokemon

kubiczi123

RoFT- First and last memb
Joined
Dec 30, 2011
Messages
102
Reaction score
11
Location
Poland
Can anyone make this script able to revive pokemons that arent fainted?
PHP:
function onUse(cid, item, frompos, item2, topos)

	if getPlayerStorageValue(cid, 990) >= 1 then
		doPlayerSendCancel(cid, "You can't use revive during gym battles.")
	return true
	end

	if item2.itemid <= 0 or not isPokeball(item2.itemid) then
		doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
	return true
	end

	for a, b in pairs (pokeballs) do
		if item2.itemid == b.off then
			doTransformItem(item2.uid, b.on)
			doSetItemAttribute(item2.uid, "hp", 1)
			for c = 1, 15 do
				local str = "move"..c
				setCD(item2.uid, str, 0)
			end
			doSendMagicEffect(getThingPos(cid), 13)
			doRemoveItem(item.uid, 1)
			doCureBallStatus(item2.uid, "all")
		return true
		end
	end

	doPlayerSendCancel(cid, "Use revive only on fainted pokémons!")	

return true
end
 
I think he want that, if you use moves and stuff and the players are lazy to wait. Then they can use the revive to remove the cooldown.
Enjoy:
Lua:
function onUse(cid, item, frompos, item2, topos) 

    if getPlayerStorageValue(cid, 990) >= 1 then 
        doPlayerSendCancel(cid, "You can't use revive during gym battles.") 
    return true 
    end 

    if item2.itemid <= 0 or not isPokeball(item2.itemid) then 
        doPlayerSendCancel(cid, "Please, use revive only on pokeballs.") 
    return true 
    end 

    for a, b in pairs (pokeballs) do 
        if item2.itemid == b.off or item2.itemid == b.on then 
            doTransformItem(item2.uid, b.on) 
            doSetItemAttribute(item2.uid, "hp", 1) 
            for c = 1, 15 do 
                local str = "move"..c 
                setCD(item2.uid, str, 0) 
            end 
            doSendMagicEffect(getThingPos(cid), 13) 
            doRemoveItem(item.uid, 1) 
            doCureBallStatus(item2.uid, "all") 
        return true 
        end 
    end 

    doPlayerSendCancel(cid, "Use revive only on fainted pokémons!")     

return true 
end
 

Similar threads

Back
Top