• 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 Mount system

Lua:
 --------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
	[2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
}
local t = {
	[5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=100, condition=bearCondition},
}
 
------------------------------------
--- don't change if you are noob ---
------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v, r = getCreaturePosition(cid), t[item.itemid]
	local s = r.s
	local pos = {x = v.x, y = v.y, z = v.z}
	if r then
		if getPlayerStorageValue(cid, s) <= 0 then
			doSendMagicEffect(pos, 10)
			doCreatureSay(cid, r.text, 19)
			setPlayerStorageValue(cid, s, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have transformed ' .. r.article .. ' '.. r.name .. '.')
			return doAddCondition(cid, r.condition)   
		elseif getPlayerStorageValue(cid, s) == 1 then
			doSendMagicEffect(pos, 10)
			doCreatureSay(cid, r.dtext, 19)
			setPlayerStorageValue(cid, s, 0)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have detransformed ' .. r.article .. ' '.. r.name .. '.')
			return doRemoveCondition(cid, CONDITION_OUTFIT)
		else
			return doPlayerSendCancel(cid, 'You can\'t do this.')
		end
	else
		return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
	end
end

Lua:
 <!-- mounting -->
<action itemid="2129" event="script" value="mountsystem.lua"/>
<action itemid="5896" event="script" value="mountsystem.lua"/>

I do some edit because i edited the script from a mount script to a transform script, lol....
It's a good script =
And I got an error that says nil value 'r' :S
 
Lua:
 --------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
    [2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
    [5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=101, condition=bearCondition}
}
 
------------------------------------
--- don't change if you are noob ---
------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local v, r = getCreaturePosition(cid), t[item.itemid]
    local s = r.s
    local pos = {x = v.x, y = v.y, z = v.z}
    if r then
        if getPlayerStorageValue(cid, s) <= 0 then
            doSendMagicEffect(pos, 10)
            doCreatureSay(cid, r.text, 19)
            setPlayerStorageValue(cid, s, 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have transformed ' .. r.article .. ' '.. r.name .. '.')
            return doAddCondition(cid, r.condition)   
        elseif getPlayerStorageValue(cid, s) == 1 then
            doSendMagicEffect(pos, 10)
            doCreatureSay(cid, r.dtext, 19)
            setPlayerStorageValue(cid, s, 0)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have detransformed ' .. r.article .. ' '.. r.name .. '.')
            return doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            return doPlayerSendCancel(cid, 'You can\'t do this.')
        end
    else
        return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
    end
end

Code:
<action itemid="2129;5896" event="script" value="mountsystem.lua"/>

fixed.
 
What was the problem???
o_O
You are fast... lol

Yeah!!! It's fixed, but now, can you install doRemoveItem??? Please!!!!!, because the scripts functs when i use the item....
 
Last edited:
Ohhhh, yes, but, it can have 2 charges, or something like that, or the script need 2 items of the same id, so when you mount, then remove one and after that, you demount and remove the otrher......
Ty, the scripts is very useful.....
 
That wouldn't be very secure since you lose the outfit condition after relog, people would cheat.

Here's the script though.

Lua:
 --------------------
---- CONDITION -----
--------------------
local wolfCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(wolfCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(wolfCondition, {lookType = 27, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local bearCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bearCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bearCondition, {lookType = 16, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
--------------------
----- config -------
--------------------
local t = {
    [2129] = {article='a' ,name='wolf', text='Transform, wolf!', dtext='DeTransform, wolf!', s=100, condition=wolfCondition},
    [5896] = {article='a' ,name='bear', text='Transform, bear!', dtext='DeTransform, bear!', s=100, condition=bearCondition}
}
 
------------------------------------
--- don't change if you are noob ---
------------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local v, r = getCreaturePosition(cid), t[item.itemid]
    local s = r.s
    local pos = {x = v.x, y = v.y, z = v.z}
    if r then
        if getPlayerStorageValue(cid, s) <= 0 then
            doSendMagicEffect(pos, 10)
            doCreatureSay(cid, r.text, 19)
            setPlayerStorageValue(cid, s, 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
            doRemoveItem(item.uid,1)
            return doAddCondition(cid, r.condition)   
        elseif getPlayerStorageValue(cid, s) == 1 then
            doSendMagicEffect(pos, 10)
            doCreatureSay(cid, r.dtext, 19)
            setPlayerStorageValue(cid, s, 0)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have demounted ' .. r.article .. ' '.. r.name .. '.')
            doRemoveItem(item.uid,1)
            return doRemoveCondition(cid, CONDITION_OUTFIT)
        else
            return doPlayerSendCancel(cid, 'You can\'t do this.')
        end
    else
        return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
    end
end
 
Is it possible to make the wolf into a orc rider instead, its not letting me do it when i change the look id.
 
It's 'Dismount' and not 'Demount'

Just so you know :)
Nice script, I must say.

Kind regards,
Spoking
 
Hey, I tried to use the mount system that increases speed. Changed the Item ID etc. But when I click on the item it says that I can't use it
 
Back
Top Bottom