Ascuas Funkeln
Rakkedo Game
- Joined
- Apr 14, 2013
- Messages
- 549
- Solutions
- 32
- Reaction score
- 307
- Location
- Poland
- GitHub
- AscuasFunkeln
Anyone have idea how to fix that? Ghost for certain time. Idea is just recast after 3 sec function...
LUA:
function addInvisible(player)
addEvent(stopInvisible, 3000, player.uid)
local isGhost = not player:isInGhostMode()
player:setGhostMode(isGhost)
if isGhost then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
end
return false
end
--THIS FK PART DONT WORK \/ --
-- After 3 second delay from addevent, function stopInvisible start and return error "attempt to index local 'player' (a number value).
function stopInvisible(player)
local isGhost = not player:isInGhostMode()
player:setGhostMode(isGhost)
if isGhost then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
end
return false
end
function onCastSpell(player)
return addInvisible(player)
end