I want a script from starter gui to tell a script in server script service to give the player a trail what is the safest way to do this so it doesn’t get exploited?
What is the best way to communicate from starter gui to server script service
Use a RemoteEvent for client - server communcation
Is this safe from exploiters? i dont want exploiters to get lots of trails for free
You can put in server script some conditions like if the player has the trail.
Add some sanity checks in the server code to verify if they have enough coins to get the item, example:
TrailEvent.OnServerEvent:Connect(function(Player) if Player.leaderstats.Cash.Value >= PriceOfTrail then --give trail to player end end)
In addition, make sure that the prices of each trail are stored on the server. Don’t let the client tell the server how much each trail costs.