Preciso de uma magia que faz o player ficar de Ghost por 3 Segundos, só pode usar essa magia a cada 60 segundos.
Magia que Faz o player ficar de GHOST por 3 segundos.

Aqui a spell
local time = 3 -- quanto tempo a magia vai dura? local spelltime = 60 -- em quanto tempo podera solta a magia denovo? local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) function onCastSpell(cid, var) if getPlayerStorageValue(cid, 2132312) < os.time () then doAddCondition(cid, invisible) doAddCondition(cid, outfit) setPlayerStorageValue(cid, 2132313, 1) setPlayerStorageValue(cid, 2132312, os.time () + spelltime) addEvent(function() if isPlayer(cid) then doRemoveCondition(cid, CONDITION_INVISIBLE) setPlayerStorageValue(cid, 2132313, -1) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) end end, time * 1000) else doPlayerSendCancel(cid, "Voce so pode usar esse magia daqui a "..getPlayerStorageValue(cid, 2132312) - os.time ().." segundos.") return false end return true end
if getPlayerStorageValue(cid, 2132313) == 1 then doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) setPlayerStorageValue(cid, 2132313, -1) end

@Edit Funcinou perfeitamente, más seria possivel ficar invisivel para os Players Também ???
Só está ficando invisivel para criaturas.
Bom pedido também gostaria do mesmo se alguem ae puder ajudar
Mapper com experiência mediana.
Retiro bugs de maps.
tem certeza?
que eu saiba ele ta ficando invisível para player
apenas cargos maiores que gm pode ver.
GAMEMASTER_INVISIBLE
você testo com mc, pra ver?

sim testei até com outros players, eles estão conseguindo me ver, meu servidor é versão 10.35 oque acho estranho é que pode ser algo relacionado aos GROUPS pois GM PODE VER GM porem GM Não pode Ver Coordenador e Coordenador não pode ver ADM ou seja somente cargos iguais podem se ver e o ADM Obvio pode ver todos do cargo abaixo de GHOST.
Pra funcionar, vai ter que arrumar um jeito de por o player no group id de Tutor.
eu fiz ela com base no TFS 0.4 para baixo
que TFS você ta usando?

TFS 3.8 da OTXServer.
Acho que ja sei o que posso fazer, teria como você colocar pra setar Group ID 2, vou criar uma especie de group tutor sem comandos tipo aqueles tutores de ot 8.50 que continua sendo player más é tutor kkkk
Ele ficaria o group 2 ou sairia em tal tempo?
local time = 3 -- quanto tempo a magia vai dura? local spelltime = 60 -- em quanto tempo podera solta a magia denovo? local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) function onCastSpell(cid, var) if getPlayerStorageValue(cid, 2132312) < os.time () then doAddCondition(cid, invisible) doAddCondition(cid, outfit) setPlayerGroupId(cid, 2) setPlayerStorageValue(cid, 2132313, 1) setPlayerStorageValue(cid, 2132312, os.time () + spelltime) addEvent(function() if isPlayer(cid) then doRemoveCondition(cid, CONDITION_INVISIBLE) setPlayerStorageValue(cid, 2132313, -1) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) end end, time * 1000) else doPlayerSendCancel(cid, "Voce so pode usar esse magia daqui a "..getPlayerStorageValue(cid, 2132312) - os.time ().." segundos.") return false end return true end
é pra sair o group 2 também junto com a magia.
local time = 3 -- quanto tempo a magia vai dura? local spelltime = 60 -- em quanto tempo podera solta a magia denovo? local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) function onCastSpell(cid, var) if getPlayerStorageValue(cid, 2132312) < os.time () then doAddCondition(cid, invisible) doAddCondition(cid, outfit) setPlayerGroupId(cid, 2) setPlayerStorageValue(cid, 2132313, 1) setPlayerStorageValue(cid, 2132312, os.time () + spelltime) addEvent(function() if isPlayer(cid) then doRemoveCondition(cid, CONDITION_INVISIBLE) setPlayerStorageValue(cid, 2132313, -1) setPlayerGroupId(cid, 1) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) end end, time * 1000) else doPlayerSendCancel(cid, "Voce so pode usar esse magia daqui a "..getPlayerStorageValue(cid, 2132312) - os.time ().." segundos.") return false end return true end
Ele voltara o player group 1 quando a magia acabar.