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

[Support] Condition

Third Aid

Banned User
Joined
Dec 14, 2009
Messages
62
Reaction score
0
Location
Sweden
This is my script, it works perfect without the condition stuff and I can't find any problems with it, would be great if someone can tell me what the problem is. :9

LUA:
  local condition = createConditionObject(CONDITION_OUTFIT)
        setConditionParam(condition, CONDITION_PARAM_TICKS, 20 * 1000)
        addOutfitCondition(condition, 0, 329, 0, 0, 0, 0)
       
function onStepIn(cid, item, position, fromPosition)
        if getGlobalStorageValue(9000) == 1 then
                if getGlobalStorageValue(9002) >= getGlobalStorageValue(9001) then
                        doTeleportThing(cid, {x=4972, y=5072, z=9})
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
                        doSendMagicEffect(fromPosition, CONST_ME_POFF)
                        setPlayerStorageValue(cid, 9000, 1)
                        setGlobalStorageValue(9001, getGlobalStorageValue(9001)+1)
                        doAddCondition(cid, condition)
                        doPlayerSendTextMessage(cid, 28, "You joined the orcs!")
                else
                        doTeleportThing(cid, fromPosition)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                        doPlayerSendTextMessage(cid, 28, "[AUTO-TEAMBALANCE] There are too many orcs!")
                end
        else
                doTeleportThing(cid, fromPosition)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                doPlayerSendTextMessage(cid, 28, "Capture the Flag is closed.")
        end
return true
end

Error message:
[15/12/2009 19:27:56] Description:
[15/12/2009 19:27:56] attempt to index a number value
[15/12/2009 19:27:56] [Warning - Event::loadScript] Cannot load script (data/movements/scripts...]

:S
 
Last edited:
Id like to know this aswell, Ive been trying to make a script that adds a condition when player logs in, but none of the "condition functions" seem to work for me and I never figured what was my mistake..
(for example, adding "invisible" condition to a player right when logging in, etc)

I guess its the same or very similar problem as you have so Ill +rep anyone who help us.
 
I'm pretty sure I used exactly the same condition as above and it worked when I used 0.3.5, I think the problem is with the latest Crying Damson.
I'm not sure tho
 
Maybe its function name change(again?)
Try createCondition maybe, or maybe CombatConditionFunct(no idea how to use it, in sources it looks like(caster, target, params)for me, but I guess its createCondition(dunno where to search this change so used find in files for all source lol)
 
I tried but those functions didn't exist.
Since I get this error message with the script above:
[15/12/2009 19:27:56] Description:
[15/12/2009 19:27:56] attempt to index a number value
[15/12/2009 19:27:56] [Warning - Event::loadScript] Cannot load script (data/movements/scripts...]

The function should still work, otherwise it would say (a nil value), right?

Well, the problem is this line:
addOutfitCondition(condition, 0, 329, 0, 0, 0, 0)

But I can't figure out what the error message means ^^
 
@Topic Starter,
LUA:
addOutfitCondition(condition, lookTypeEx, lookType, lookHead, lookBody, lookLegs, lookFeet)

Try this :p
 
Back
Top