Hello, I have a game with a custom hot bar. There is a string value called Selected Item inside the player, and it’s managed by the client. A loop every second will send the value of Selected Item to the server and the server equips it. However, the client can never be trusted so I need a debounce from the server side. But if the player switches items too fast, it can glitch and the server doesn’t show the tool.
Long story short, how do I detect the name of a tool that a player is holding? I need to detect this from the client btw. Thanks for your answer!
Hi first of, don’t have a loop sending signal to the server all the time, it’s not neccessary
Instead do the following:
Client should fire remote to the server, if it wants to equip anything. Example: Client presses 1 for hotbar 1, in hotbar1 they have a sword. The Client sends signal to the server, that they pressed 1.
Server handles what happens next. Server checks what player have equipped in slot 1, and then equip the item for them.
The loop doesn’t always fire. There is a variable to make sure it only fires when the selected item change. But I’ve fixed the problem now However, I need to know what tool the player is holding from the server side now. Because I need to remove the item from the player’s hand when they don’t have that item in their inventory folder anymore. How can I check what tool is a player holding from the server side?