• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Taming Inoperatives - Some fun.

lokolokio

Well-Known Member
Joined
Jan 7, 2009
Messages
201
Solutions
13
Reaction score
78
Location
Mexico
Hello dear OtLanders i have this script because i think its a great way to tamming the inoperatives, you can change all values and if theres some bugs plx anyone can tell me how to fix, but on my opinion its very good and nice script. i put the next screenshoot to see what im talking about.

189258_431402080250953_284171308_n.jpg


Lua:
function onUse(cid,item,fromPosition,itemEx,toPosition)

	local storageUniwheel = 2024
	local storageTL = 2025
	local mountIdUniwheel = 15
	local mountIdLizzard = 8
	local rand = math.random(1, 100)
	local percentageToBrokeOil = 45
	local percentageToBrokeKey = 45
	local percentageToGetOilMount = 8
	local percentageToGetKeyMount = 8

	if(item.itemid == 13938 and itemEx.itemid == 13937)then
		if(getPlayerStorageValue(cid, storageUniwheel) <= 0)then
			if(rand <= percentageToGetOilMount)then
				doCreatureSay(cid, 'Vroooomratatatatatatat. The strange wheel seems to vibrate and slowly starts turning continuously.', TALKTYPE_ORANGE_1)
				doSendMagicEffect(toPosition, 67)
				addEvent(doSendMagicEffect, 300, toPosition, 67)
				addEvent(doSendMagicEffect, 600, toPosition, 67)
				addEvent(doSendMagicEffect, 900, toPosition, 67)
				doPlayerAddMount(cid, mountIdUniwheel)
				setPlayerStorageValue(cid, storageUniwheel, 1)
			elseif(rand <= percentageToBrokeOil)then
				doCreatureSay(cid, 'Splosh! It looks like most of the special oil this can was holding was spilt without any effect.', TALKTYPE_ORANGE_1)
				doRemoveItem(item.uid, 1)
			else
				doCreatureSay(cid, 'There is not enough oil, try to put more in the uniwheel.', TALKTYPE_ORANGE_1)
			end
		else
			doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)			
		end

	elseif(item.itemid == 13292 and itemEx.itemid == 13306)then
		if(getPlayerStorageValue(cid, storageTL) <= 0)then
			if(rand <= percentageToGetKeyMount)then
				doCreatureSay(cid, 'Krkrkrkrk You wind up the tin lizzard.', TALKTYPE_ORANGE_1)
				doSendMagicEffect(toPosition, 67)
				addEvent(doSendMagicEffect, 300, toPosition, 67)
				addEvent(doSendMagicEffect, 600, toPosition, 67)
				addEvent(doSendMagicEffect, 900, toPosition, 67)
				doPlayerAddMount(cid, mountIdLizzard)
				setPlayerStorageValue(cid, storageTL, 1)
			elseif(rand <= percentageToBrokeKey)then
				doCreatureSay(cid, 'You broke the key while you are trying to star up the tin lizzard.', TALKTYPE_ORANGE_1)
				doRemoveItem(item.uid, 1)
			else
				doCreatureSay(cid, 'The key does not match, try again.', TALKTYPE_ORANGE_1)
			end
		else
			doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)			
		end
	end
end
 

Attachments

Last edited by a moderator:
Improved your code a bit, also fixed a problem that you weren't removing the item used if you obtained the mount

Lua:
local mounts = {
    [13938] = { --Uniwheel
        storage = 2024, id = 15, itemBreak = 45, mountGet = 8, mountItem = 13937
        getMessage = "Vroooomratatatatatatat. The strange wheel seems to vibrate and slowly starts turning continuously.",
        breakMessage = "Splosh! It looks like most of the special oil this can was holding was spilt without any effect.",
        failMessage = "There is not enough oil, try to put more in the uniwheel.",
    },
    [13292] = { --Tin Lizzard
        storage = 2025, id = 8, itemBreak = 45, mountGet = 8, mountItem = 13306
        getMessage = "Krkrkrkrk You wind up the tin lizzard.",
        breakMessage = "You broke the key while you are trying to star up the tin lizzard.",
        failMessage = "The key does not match, try again.",
    }
}


function onUse(cid,item,fromPosition,itemEx,toPosition)
    local rand = math.random(1, 100)
    if(mounts[item.itemid] and itemEx.itemid == mounts[item.itemid].mountItem)then
        if(getPlayerStorageValue(cid, mounts[item.itemid].storage) <= 0)then
            if(rand <= mounts[item.itemid].mountGet) then
                doCreatureSay(cid, mounts[item.itemid].getMessage, TALKTYPE_ORANGE_1)
                doSendMagicEffect(toPosition, 67)
                addEvent(doSendMagicEffect, 300, toPosition, 67)
                addEvent(doSendMagicEffect, 600, toPosition, 67)
                addEvent(doSendMagicEffect, 900, toPosition, 67)
                doPlayerAddMount(cid, mounts[item.itemid].id)
                setPlayerStorageValue(cid, mounts[item.itemid].storage, 1)
                doRemoveItem(item.uid, 1)
            elseif(rand <= mounts[item.itemid].itemBreak) then
                doCreatureSay(cid, mounts[item.itemid].breakMessage, TALKTYPE_ORANGE_1)
                doRemoveItem(item.uid, 1)
            else
                doCreatureSay(cid, mounts[item.itemid].failMessage, TALKTYPE_ORANGE_1)
            end
        else
            doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
        end
    end
end
 
Last edited:
Improved your code a bit, also fixed a problem that you weren't removing the item used if you obtained the mount

Lua:
local mounts = {
    [13938] = { --Uniwheel
        storage = 2024, id = 15, itemBreak = 45, mountGet = 8, mountItem = 13937
        getMessage = "Vroooomratatatatatatat. The strange wheel seems to vibrate and slowly starts turning continuously.",
        breakMessage = "Splosh! It looks like most of the special oil this can was holding was spilt without any effect.",
        failMessage = "There is not enough oil, try to put more in the uniwheel.",
    }
    [13292] = { --Tin Lizzard
        storage = 2025, id = 8, itemBreak = 45, mountGet = 8, mountItem = 13306
        getMessage = "Krkrkrkrk You wind up the tin lizzard.",
        breakMessage = "You broke the key while you are trying to star up the tin lizzard.",
        failMessage = "The key does not match, try again.",
    }
}


function onUse(cid,item,fromPosition,itemEx,toPosition)
    local rand = math.random(1, 100)
    if(mounts[item.itemid] and itemEx.itemid == mounts[item.itemid].mountItem)then
        if(getPlayerStorageValue(cid, mounts[item.itemid].storage) <= 0)then
            if(rand <= mounts[item.itemid].mountGet) then
                doCreatureSay(cid, mounts[item.itemid].getMessage, TALKTYPE_ORANGE_1)
                doSendMagicEffect(toPosition, 67)
                addEvent(doSendMagicEffect, 300, toPosition, 67)
                addEvent(doSendMagicEffect, 600, toPosition, 67)
                addEvent(doSendMagicEffect, 900, toPosition, 67)
                doPlayerAddMount(cid, mounts[item.itemid].id)
                setPlayerStorageValue(cid, mounts[item.itemid].storage, 1)
                doRemoveItem(item.uid, 1)
            elseif(rand <= mounts[item.itemid].itemBreak) then
                doCreatureSay(cid, mounts[item.itemid].breakMessage, TALKTYPE_ORANGE_1)
                doRemoveItem(item.uid, 1)
            else
                doCreatureSay(cid, mounts[item.itemid].failMessage, TALKTYPE_ORANGE_1)
            end
        else
            doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
        end
    end
end

doesnt work for me. heres the error :
[15:19:05.733] [Error - LuaInterface::loadFile] data/actions/scripts/inoperativetaming.lua:5: '}' expected <to close '{' at line 3> near 'getMessage'
 
@dragocodez

I've fixed it where it removes the item when obtaining the mount, with no errors.
I already tested it, i know it works!! :D


Code:
function onUse(cid,item,fromPosition,itemEx,toPosition)
local storageUniwheel = 2024
local storageTL = 2025
local mountIdUniwheel = 15
local mountIdLizzard = 8
local rand = math.random(1, 100)
local percentageToBrokeOil = 45
local percentageToBrokeKey = 45
local percentageToGetOilMount = 10
local percentageToGetKeyMount = 10
if(item.itemid == 13938 and itemEx.itemid == 13937)then
if(getPlayerStorageValue(cid, storageUniwheel) <= 0)then
if(rand <= percentageToGetOilMount)then
doCreatureSay(cid, 'Vroooomratatatatatatat. The strange wheel seems to vibrate and slowly starts turning continuously.', TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, 67)
addEvent(doSendMagicEffect, 300, toPosition, 67)
addEvent(doSendMagicEffect, 600, toPosition, 67)
addEvent(doSendMagicEffect, 900, toPosition, 67)
doPlayerRemoveItem(cid, 13938, 1)
doPlayerAddMount(cid, mountIdUniwheel)
setPlayerStorageValue(cid, storageUniwheel, 1)
elseif(rand <= percentageToBrokeOil)then
doCreatureSay(cid, 'Splosh! It looks like most of the special oil this can was holding was spilt without any effect.', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, 'There is not enough oil, try to put more in the uniwheel.', TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
end
elseif(item.itemid == 13292 and itemEx.itemid == 13306)then
if(getPlayerStorageValue(cid, storageTL) <= 0)then
if(rand <= percentageToGetKeyMount)then
doCreatureSay(cid, 'Krkrkrkrk You wind up the tin lizzard.', TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, 67)
addEvent(doSendMagicEffect, 300, toPosition, 67)
addEvent(doSendMagicEffect, 600, toPosition, 67)
addEvent(doSendMagicEffect, 900, toPosition, 67)
doPlayerRemoveItem(cid, 13292,1)
doPlayerAddMount(cid, mountIdLizzard)
setPlayerStorageValue(cid, storageTL, 1)
elseif(rand <= percentageToBrokeKey)then
doCreatureSay(cid, 'You broke the key while you are trying to star up the tin lizzard.', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, 'The key does not match, try again.', TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
end
end
end
 
@dragocodez

I've fixed it where it removes the item when obtaining the mount, with no errors.
I already tested it, i know it works!! :D


Code:
function onUse(cid,item,fromPosition,itemEx,toPosition)
local storageUniwheel = 2024
local storageTL = 2025
local mountIdUniwheel = 15
local mountIdLizzard = 8
local rand = math.random(1, 100)
local percentageToBrokeOil = 45
local percentageToBrokeKey = 45
local percentageToGetOilMount = 10
local percentageToGetKeyMount = 10
if(item.itemid == 13938 and itemEx.itemid == 13937)then
if(getPlayerStorageValue(cid, storageUniwheel) <= 0)then
if(rand <= percentageToGetOilMount)then
doCreatureSay(cid, 'Vroooomratatatatatatat. The strange wheel seems to vibrate and slowly starts turning continuously.', TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, 67)
addEvent(doSendMagicEffect, 300, toPosition, 67)
addEvent(doSendMagicEffect, 600, toPosition, 67)
addEvent(doSendMagicEffect, 900, toPosition, 67)
doPlayerRemoveItem(cid, 13938, 1)
doPlayerAddMount(cid, mountIdUniwheel)
setPlayerStorageValue(cid, storageUniwheel, 1)
elseif(rand <= percentageToBrokeOil)then
doCreatureSay(cid, 'Splosh! It looks like most of the special oil this can was holding was spilt without any effect.', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, 'There is not enough oil, try to put more in the uniwheel.', TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
end
elseif(item.itemid == 13292 and itemEx.itemid == 13306)then
if(getPlayerStorageValue(cid, storageTL) <= 0)then
if(rand <= percentageToGetKeyMount)then
doCreatureSay(cid, 'Krkrkrkrk You wind up the tin lizzard.', TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, 67)
addEvent(doSendMagicEffect, 300, toPosition, 67)
addEvent(doSendMagicEffect, 600, toPosition, 67)
addEvent(doSendMagicEffect, 900, toPosition, 67)
doPlayerRemoveItem(cid, 13292,1)
doPlayerAddMount(cid, mountIdLizzard)
setPlayerStorageValue(cid, storageTL, 1)
elseif(rand <= percentageToBrokeKey)then
doCreatureSay(cid, 'You broke the key while you are trying to star up the tin lizzard.', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, 'The key does not match, try again.', TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, 'You have already this mount.', TALKTYPE_ORANGE_1)
end
end
end

just complementing your script...

If you use the item on the floor it doesn't remove..

then you just need to change
Code:
doPlayerRemoveItem(cid, 13938, 1)
to
Code:
doRemoveItem(item.uid, 1)

^^

sorry for my bad english
 
Last edited:
Back
Top