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?
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