Postado Março 27, 2017 8 anos Bom gente queria que alguem ajuda-se eu a modifica esse script pra fica funcionando perfeitamente. drown.lua (data\movements\scripts) Spoiler local speed, key = 100, 45678 -- value, storage key local condition = createConditionObject(CONDITION_DROWN) setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000) local function checkDrowning(uid) local item = 5461 -- Helmet of the Deep Id if getPlayerSlotItem(uid, CONST_SLOT_HEAD).itemid == item and getPlayerStorageValue(uid, key) < 1 then doChangeSpeed(uid, getCreatureSpeed(uid) + speed) setPlayerStorageValue(uid, key, 1) elseif not getPlayerSlotItem(uid, CONST_SLOT_HEAD).itemid == item and getPlayerStorageValue(uid, key) > 0 then doChangeSpeed(uid, getCreatureSpeed(uid) - speed) setPlayerStorageValue(uid, key, -1) end return true end function onStepIn(cid) return isPlayer(cid) and doAddCondition(cid, condition) and checkDrowning(cid) or true end function onStepOut(cid) return getPlayerStorageValue(cid, key) > 0 and doChangeSpeed(cid, getCreatureSpeed(cid) - speed) and setPlayerStorageValue(cid, key, -1) and doRemoveCondition(cid, CONDITION_DROWN) or doRemoveCondition(cid, CONDITION_DROWN) end Spoiler <movevent type="StepIn" fromid="5405" toid="5410" event="script" value="drown.lua"/> <movevent type="StepOut" fromid="5405" toid="5410" event="script" value="drown.lua"/> gostaria de pedir ajuda de vocês quando player estiver com Helmet of the Deep ItemID: [5461]. apenas quando tiver debaixo d'água sua velocidade aumentar +100 de speed, alguém poderia me ajudar. OBS: bom o script acima esta funcionando, mais quando o player andar 3 sqms. o player leva o paralyze infinito, nao acaba com nada. Editado Março 27, 2017 8 anos por Admnwso (veja o histórico de edições)
Postado Março 28, 2017 8 anos 18 horas atrás, Admnwso disse: Bom gente queria que alguem ajuda-se eu a modifica esse script pra fica funcionando perfeitamente. drown.lua (data\movements\scripts) Mostrar conteúdo oculto local speed, key = 100, 45678 -- value, storage key local condition = createConditionObject(CONDITION_DROWN) setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000) local function checkDrowning(uid) local item = 5461 -- Helmet of the Deep Id if getPlayerSlotItem(uid, CONST_SLOT_HEAD).itemid == item and getPlayerStorageValue(uid, key) < 1 then doChangeSpeed(uid, getCreatureSpeed(uid) + speed) setPlayerStorageValue(uid, key, 1) elseif not getPlayerSlotItem(uid, CONST_SLOT_HEAD).itemid == item and getPlayerStorageValue(uid, key) > 0 then doChangeSpeed(uid, getCreatureSpeed(uid) - speed) setPlayerStorageValue(uid, key, -1) end return true end function onStepIn(cid) return isPlayer(cid) and doAddCondition(cid, condition) and checkDrowning(cid) or true end function onStepOut(cid) return getPlayerStorageValue(cid, key) > 0 and doChangeSpeed(cid, getCreatureSpeed(cid) - speed) and setPlayerStorageValue(cid, key, -1) and doRemoveCondition(cid, CONDITION_DROWN) or doRemoveCondition(cid, CONDITION_DROWN) end Mostrar conteúdo oculto <movevent type="StepIn" fromid="5405" toid="5410" event="script" value="drown.lua"/> <movevent type="StepOut" fromid="5405" toid="5410" event="script" value="drown.lua"/> gostaria de pedir ajuda de vocês quando player estiver com Helmet of the Deep ItemID: [5461]. apenas quando tiver debaixo d'água sua velocidade aumentar +100 de speed, alguém poderia me ajudar. OBS: bom o script acima esta funcionando, mais quando o player andar 3 sqms. o player leva o paralyze infinito, nao acaba com nada. Também estou na duvida
Postado Maio 10, 2017 8 anos Spoiler local c = { speed = 100, key = 45678, item = 5461 } local condition = createConditionObject(CONDITION_DROWN) setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000) local isChanged = {} local function checkDrowning(cid) local storage = tonumber(getPlayerStorageValue(cid, c.key)) or 0 if(getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == c.item) then isChanged[cid] = getCreatureSpeed(cid) doChangeSpeed(cid, isChanged[cid] + (storage < 1 and c.speed or -c.speed)) setPlayerStorageValue(cid, c.key, (storage < 1 and 1 or -1)) end return true end function onStepIn(cid) if(isPlayer(cid) and not isChanged[cid]) then doAddCondition(cid, condition) checkDrowning(cid) end return true end function onStepOut(cid) doChangeSpeed(cid, isChanged[cid] or getCreatureSpeed(cid)) setPlayerStorageValue(cid, c.key, -1) doRemoveCondition(cid, CONDITION_DROWN) return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.