Author Topic: Find Max Tools [Solved]  (Read 1528 times)

What's a good way to find a player's max tool slots if there's a custom number?
« Last Edit: December 01, 2014, 03:15:26 AM by tommybricksetti »

Pretty sure there's a variable on the player datablock.

Yeah, but I mean if the slot number is changed without changing the datablock.

Yeah, but I mean if the slot number is changed without changing the datablock.

You mean when they use a slot?

serverCmdUseTool (or serverCmdUseItem ... On iPad right now).

All the default game functions regarding tools refer to %obj.getDataBlock().maxTools.

Quote
//ReOpen tool Gui
function KeybladeToolOpen(%client,%slot,%tools)
{
   commandToClient(%client,'SetScrollMode',3);
   commandToClient(%client,'PlayGui_CreateToolHud',%tools);
   commandToClient(%client,'SetScrollMode',$SCROLLMODE_TOOLS);
   commandToClient(%client,'SetActiveTool',%slot);
}
I can set the max tools, but I don't know how to restore them.

Never mind. I realized it was better to define max tools in the main datablock, instead of changing it onAdd. Then I just use %data.maxTools in the restore function.

commandToClient(%client,'PlayGui_CreateToolHud',%tools);

This isn't actually setting the player's tool limit. It's just tricking the client into making it show more tool slots on the HUD.