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

tfs 1.5 8.0

Mateus Robeerto

Excellent OT User
Joined
Jun 5, 2016
Messages
1,337
Solutions
71
Reaction score
697
Location
ლ(ಠ益ಠლ)
For example, if the player killed the player , a message will be displayed to all players, revealing those involved. For example: 'PvP: So-and-so eliminated So-and-so2 (xxx points)'. Also, does anyone know how to add functionality to take actions when points are awarded to a player, resulting in enough score for some sort of functionality? For example, when a kill occurs and the player earns points, does anyone know how to add this functionality to the system?

Lua:
if killer:isPlayer() then
        Game.broadcastMessage(player:getName().."["..player:getLevel().."] Pvp: killed "..killer:getName().."["..killer:getLevel().."].", MESSAGE_STATUS_DEFAULT)
    end
 
Last edited:
Example: when player "So-and-so" kills player "So-and-so2", a broadcast message is displayed to all players stating who killed who. For example: "PvP: So-and-so killed So-and-so2". Also, next to or below that message, when a kill occurs and the player earns points, does anyone know how to add that kind of functionality as well?

Lua:
if killer:isPlayer() then
        Game.broadcastMessage(player:getName().."["..player:getLevel().."] Pvp: killed "..killer:getName().."["..killer:getLevel().."].", MESSAGE_STATUS_DEFAULT)
    end
I really don't understand what you want.

Anyway use onpreparedeath to broadcast msg and give the killer the reward.

Lua:
function onPrepareDeath(...)
if killer:isPlayer() then
      -- broadcast msg here
      -- rewardfunction here
end
return true
end
 
Last edited:
This is exactly what I want. For example, when the message appears: 'PvP Vortex killed So-and-so, 50 points', this happens randomly when killing someone and earning points
Lua:
if killer:isPlayer() then
    local points = 10
    killer:setPoints(killer:getPoints() + points)
   
    Game.broadcastMessage("PvP: "..killer:getName().."["..killer:getLevel().."] killed "..player:getName().."["..player:getLevel().."] and won "..points.." points.", MESSAGE_STATUS_DEFAULT)
end

I don't know exactly how this scoring system works. For example, when I kill a player that has a high score, I gain a higher percentage of points, according to the score of the player I killed. You understand?
 
This is exactly what I want. For example, when the message appears: 'PvP Vortex killed So-and-so, 50 points', this happens randomly when killing someone and earning points
Lua:
if killer:isPlayer() then
    local points = 10
    killer:setPoints(killer:getPoints() + points)
   
    Game.broadcastMessage("PvP: "..killer:getName().."["..killer:getLevel().."] killed "..player:getName().."["..player:getLevel().."] and won "..points.." points.", MESSAGE_STATUS_DEFAULT)
end

I don't know exactly how this scoring system works. For example, when I kill a player that has a high score, I gain a higher percentage of points, according to the score of the player I killed. You understand?
I understand what you want, but it will depend on you to make this point system. you can use storage in order to store the player's score, remove, add and use a calculation, such as 10% of what he holds and transfer these points to whoever kills him.

you just have to make sure that whole numbers are removed, if you want to lose 3.5 points, round it up or down.

and also add an exception for when the dead player has no points.

If its like 10 fix points, its easy
 
Last edited:
Back
Top