[ScoreBoard with cuberite]
#1
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 ^^
Reply
Thanks given by:
#2
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 ^^
Reply
Thanks given by:
#3
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


Attached Files
.png   Screenshot_2.png (Size: 48.62 KB / Downloads: 392)
Reply
Thanks given by:
#4
That's a screenshot of an abused scoreboard. Fake "players" with fake "scores" on the right
Reply
Thanks given by:
#5
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...)
Reply
Thanks given by:




Users browsing this thread: 4 Guest(s)