• 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!

OTC - Disable targeting player with runes on battle list

danne3131

Active Member
Joined
Jun 26, 2008
Messages
390
Solutions
1
Reaction score
48
Hello guys, im wondering where i disable the targeting of players on the battle list on OTC

Right now you can just right click a rune (SD for instance) and shoot a player through battle list.
Since im working on a 7.4 this is not the way to keep it for sure!

Any help is appreciated! Cheers
 
@MagicWall that disable'd the whole battlelist :p I just still want players to be able to shoot runes on creatures via battle list but not shoot on other players =)
 
Add condition, if isPlayer then blabla.
 
Lua:
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature then
      g_game.useWith(selectedThing, creature)
    end
  end
end


Ive tried edited this, but since im no expert i guess im doing wrong ? or am i editing the wrong piece of code?
 
Lua:
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature then
      g_game.useWith(selectedThing, creature)
    end
  end
end


Ive tried edited this, but since im no expert i guess im doing wrong ? or am i editing the wrong piece of code?

I'm expert, don't worry.
Now, look how hard it is, I will show you how does an expert with this:

Lua:
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature then
      --g_game.useWith(selectedThing, creature) (comment or remove this line)
    end
  end
end

WOOOW! That's crazy, man!
Next time, ask for something more easy.


OBS: Kidding, for those who don't get it.
 
I'm expert, don't worry.
Now, look how hard it is, I will show you how does an expert with this:

Lua:
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature then
      --g_game.useWith(selectedThing, creature) (comment or remove this line)
    end
  end
end

WOOOW! That's crazy, man!
Next time, ask for something more easy.


OBS: Kidding, for those who don't get it.

Creature = Players only? I tought that could be monsters and players lol..

Anyway your code didnt work haha, cant use runes on monsters now as before.

Im thinknig of something like this
Lua:
  elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
    g_game.useWith(selectedThing, clickedWidget:getItem())
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if creature:isPlayer then
    else
    g_game.useWith(selectedThing, creature)
    end
  end
end
 
Last edited:
I though you wanted to disable the runes target on battle list.

Lua:
  elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
    g_game.useWith(selectedThing, clickedWidget:getItem())
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if not creature:isPlayer() then
        g_game.useWith(selectedThing, creature)
    end
  end
end

This will make able to use with items on battle list only if the target is NOT player.
 
I though you wanted to disable the runes target on battle list.

Lua:
  elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
    g_game.useWith(selectedThing, clickedWidget:getItem())
  elseif clickedWidget:getClassName() == 'UICreatureButton' then
    local creature = clickedWidget:getCreature()
    if not creature:isPlayer() then
        g_game.useWith(selectedThing, creature)
    end
  end
end

This will make able to use with items on battle list only if the target is NOT player.
I tried exactly this, but i did not put () after isPlayer.. What does that actually mean? =)

Tried this code, and it worked =) Thanks!
 
I tried exactly this, but i did not put () after isPlayer.. What does that actually mean? =)

Tried this code, and it worked =) Thanks!
"function()"

if you put just "function", its used like variable. with "()" its used as function
 
Back
Top