EduardoDantas
Intermediate OT User
I am creating a "sauron ring" script just like the Lord of the Rings.
I was able to make the script functional, but when testing I came across a pretty chatinha function: when equipping the player it is invisible and everything, but also it has the condition of not being able to be attacked (which is annoying, since I intend to do with that by taking hit the player who has the equipped ring loses the condition of invisibility for x seconds and then returns to become invisible)
Can somebody get a light?
Searching I came to the conclusion that to change this I will have to tinker with the sources, but I have no idea how to change this, my knowledge in c ++ are shallow, to say nothing, haha
Can someone give a light?
I was able to make the script functional, but when testing I came across a pretty chatinha function: when equipping the player it is invisible and everything, but also it has the condition of not being able to be attacked (which is annoying, since I intend to do with that by taking hit the player who has the equipped ring loses the condition of invisibility for x seconds and then returns to become invisible)
Can somebody get a light?
Searching I came to the conclusion that to change this I will have to tinker with the sources, but I have no idea how to change this, my knowledge in c ++ are shallow, to say nothing, haha
Can someone give a light?
Code:
function onEquip(cid, item, slot)
local player = Player(cid)
if isPlayer() then
return true
end
local position = player:getPosition()
local isGhost = not player:isInGhostMode()
item:transform(2202)
player:setGhostMode(isGhost)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are invisible.")
-- position.x = position.x + 1
position:sendMagicEffect(67)
return true
end
function onDeEquip(cid, item, slot)
local player = Player(cid)
if isPlayer() then
return true
end
local position = player:getPosition()
local isGhost = not player:isInGhostMode()
item:transform(2165)
player:setGhostMode(isGhost)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
-- position.x = position.x + 1
position:sendMagicEffect(67)
return true
end