Help with a hint system

I’m trying to give my players some hints to help them progress in the game.
They’ll only be granted so many hints per day. So when they use a hint it must remove it from the server.

The conundrum I am facing is that the only way I see this working is a remote event to the server that removes 1 hint, since this is done via a gui.

However if a hijacker were to get hold of that event, he could deplete everyone’s hints by means of a for loop and the aformentinoned remote.

What’s another way to do this?

1 Like

They shouldn’t be able to deplete everyone else’s hints. When you fire a remote event or invoke a remote function to the server, the OnServerEvent/OnServerInvoke gives you 1 argument by default, the Player who fired the remote. When the client asks the server to use a hint, all you have to do is:

  1. Check if they have above 0 hints

  2. Decrement their # of hints, then remove it from the pool if that’s what you wanna do

  3. If you’re using a remote event, fire back a hint to the client. If you’re using a remote function (what I would probably do, since you’d like the result of this call) then just return the hint.

You shouldn’t have anything to worry about since your server code should only be manipulating the data of the player who fired/invoked the remote.

4 Likes

That makes sense. I guess I was just over thinking things again lol.

Thank you for the feedback :slight_smile: