Cuberite Forum
[ScoreBoard with cuberite] - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: [ScoreBoard with cuberite] (/thread-3214.html)



[ScoreBoard with cuberite] - Yann - 01-06-2019

Hello ! I would like to do a simple scoreboard to display username, userrank and number of connected players but even with the documentation I don't understand how they work.
(I've tried checking source code but I don't see why all cScoreboard functions aren't working)

Here is the error I always got:



Code:
LUA: Plugins/ValeaCore/main.lua:8: error in function 'AddPlayerScore'.
    argument #1 is 'string'; 'cScoreboard' expected.


Thank's for the help you will give ^^


RE: [ScoreBoard with cuberite] - Yann - 01-06-2019

I made this code that run but I don't see any scoreboard :/
Code:
---Main file

PLUGIN = nil

function Initialize(Plugin)
   --Initialisation
   Plugin:SetName('ValeaCore');
   Plugin:SetVersion(0.1);

   --Events
   cPluginManager:AddHook(cPluginManager.HOOK_WORLD_TICK, scoreBoardTask);

   PLUGIN = Plugin;
   LOG(Plugin:GetName()..' loaded in version '..Plugin:GetVersion());

   return true

end

function OnDisable(Plugin)
   LOG(Plugin:GetName().. 'disabled');
end


--Scoreboard file


function updateScoreBoard(World)
   World:GetScoreBoard():RegisterObjective('cos', 'Joueurs en ligne:', 4);
   World:GetScoreBoard():SetDisplay('cos', 2);
   World:GetScoreBoard():SetDisplay('cos', 0)
end

function scoreBoardTask(World, TimeDelta)
   cRoot:Get():ForEachWorld(updateScoreBoard);
end

I know that scoreBoardTask is running becasue is tried logging ^^



RE: [ScoreBoard with cuberite] - Yann - 01-06-2019

So finally it prints well but I need to press tab to display it :/
That's strange :c

Is there any way to emulate this press ?

Also, I would like to have something that looks like this (see attachment) but I don't see how I can do it
.
Thanks for the hekp you'll give :p


RE: [ScoreBoard with cuberite] - Cl1608Ho - 01-06-2019

That's a screenshot of an abused scoreboard. Fake "players" with fake "scores" on the right


RE: [ScoreBoard with cuberite] - Yann - 01-06-2019

This screenshot is from a famous french server running on bukkit.
I just wanted help to make the same scoreboard (set a title, display custom names...)