• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

One Click and Death

flaviiojr

Active Member
Joined
Jan 20, 2017
Messages
230
Solutions
13
Reaction score
39
I wanted a ring that when giving use, it needs to be equipped, the player will die..

TFS 1.3
Client 10.99
 
if you do this the player will never be able to log back in.
onEquip function executes when the player logs in, if you make them die when they equip it they will relog and it will execute again, causing infinite death.
 
more than how to fix this im just wondering like why? i would love to know whats the purpose behind this idea like "here take this ring now die" like lol wtf?
 
How about equipping the ring and then remove it from the player before he dies?

movements.xml
Lua:
<movevent event="Equip" itemid="ring id" slot="ring" function="onEquipItem" />

script
Lua:
function onEquip(player, item, slot, isCheck)
    -- remove the item before we kill them
    item:remove()
    -- kill the player
    player:addHealth(-player:getMaxHealth())
    return true
end
 
I wanted a ring that when giving use, it needs to be equipped, the player will die..9
that when giving use
I believe what he said in his broken English is using the ring makes the player die, not equipping it
if you do this the player will never be able to log back in.
onEquip function executes when the player logs in, if you make them die when they equip it they will relog and it will execute again, causing infinite death.
That's cool, I didn't know that
 
I wanted a ring that when giving use, it needs to be equipped, the player will die..

TFS 1.3
Client 10.99

I believe what he said in his broken English is using the ring makes the player die, not equipping it

That's cool, I didn't know that

Yeah, if you could explain it a bit better then I may be able to write this one for you. Do you want a ring that, if equipped, makes other players (hit by the one wearing the ring) to die instantly?
 
How about equipping the ring and then remove it from the player before he dies?

movements.xml
Lua:
<movevent event="Equip" itemid="ring id" slot="ring" function="onEquipItem" />

script
Lua:
function onEquip(player, item, slot, isCheck)
    -- remove the item before we kill them
    item:remove()
    -- kill the player
    player:addHealth(-player:getMaxHealth())
    return true
end
if you bother removing the item onEquip, don't use return true afterwards.
it will try to move a null item into the cylinder it's supposed to be in
 
I believe what he said in his broken English is using the ring makes the player die, not equipping it
Yes!
The player by clicking on "use" on the ring, it will die ...
The ring should be in the ring slot to work, if it is in the backpack or anywhere else and give use nothing happens
 
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getSlotItem(CONST_SLOT_RING) == item then
        player:addHealth(-player:getMaxHealth())
        return true
    end
    return false
end
 
Back
Top