![]() ![]() Long story short, there’s nothing wrong with RemoteEvents for purchasing items in a shop. You could also implement a distance check to make sure the player is close enough to a shop stall to give the item. ![]() Perhaps instead of allowing the client to pass the name of the item, you could have it to where they only pass the number slot from their end and have the server determine what each slot represents. = pricesĪnd even then, the good system can be improved upon. ReplicatedStorage.BuyItem:FireServer(itemName) - only parameter is the name.īuyItem("Darkheart") - an exploiter no longer sets the item price because the client supplied the price, this is very vulnerable. ReplicatedStorage.BuyItem:FireServer(itemName, itemPrice)īuyItem("Darkheart", 0) - an exploiter could pass 0 to get it free. Let the server check if the item exists, check the price, and see if the player has enough.ĭoing it like this prevents any exploitation because while an exploiter could try to fire the RemoteEvent from their end to purchase something, it’s the server that verifies if the player has enough to buy it and exploiters just can’t touch the server.Ĭlient: local function buyItem(itemName, itemPrice) Instead, just have maybe one parameter - probably something like the name of the item being bought. Never let the client control that sort of information. Don’t have the player pass the price of the item as a parameter. You could have the prices for every item stored in a ServerScript in a table. Structure the parameters for purchasing items in a store as minimally as possible. ![]() RemoteEvents will always eventually be necessary at some point - the general rule is to just minimize their usage as much as possible and verify any pertinent info on the server’s end only. You can use a RemoteEvent to have players purchase store items, for sure. Sometimes there’s no way around using them. RemoteEvents are perfectly fine in moderation. Could someone please help me understand / tell me a way on how to work around this? I want the game to be as safe as possible, but am not sure of any way to avoid using remoteEvents for this. My issue is that I do not know any work arounds to avoid using RemoteEvents. I got one of my friends to see what damage he could do while hacking, and he was able to make all of the events function without purchasing them because he was able to fire the remoteEvents. HOWEVER, I have been reading a lot up on avoiding hacks in your games, and one of them is to not use RemoteEvents when it can cause big server issues. Then when the remote event is fired, the server scripts that make the round events work, functions on the server to effect all players. The purchase is completed.In my game, during rounds, the players can purchase events to effect everyone playing (Such as faster speeds, exploding everyone, low gravity and so on).Īt the moment, It functions by the player purchasing it in the store, then that fires a remote event depending on what they are purchasing. The server purchase Script reads the player’s local leaderstats for the money.value and believes the modified value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |