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

Talkactions - !light not disable loggout

Forkz

Advanced OT User
Joined
Jun 29, 2020
Messages
586
Solutions
17
Reaction score
159
Hi otlanders,

I'm using this code below, but when the player logs off the char and logs in again, the "light" is activated but does not appear in-game, then the player has to "disable" and "enable" again to work.

Any suggestions on how to disable when the player logs out?

LUA:
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 8)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)

function onSay(cid, words, param)
if getPlayerStorageValue(cid, 54448) ~= 1 then
doAddCondition(cid, condition)
setPlayerStorageValue(cid, 54448, 1)
else
doRemoveCondition(cid, CONDITION_LIGHT)
setPlayerStorageValue(cid, 54448, 0)
end
return TRUE
end
 
Solution
X
LUA:
function onLogin(cid)
    if getPlayerStorageValue(cid, 54448) == 1 then
        addEvent(doCreatureExecuteTalkAction, 50, cid, "!light")
        addEvent(doCreatureExecuteTalkAction, 100, cid, "!light")
    end
    return true
end
LUA:
function onLogin(cid)
    if getPlayerStorageValue(cid, 54448) == 1 then
        addEvent(doCreatureExecuteTalkAction, 50, cid, "!light")
        addEvent(doCreatureExecuteTalkAction, 100, cid, "!light")
    end
    return true
end
 
Solution
Back
Top