What is the best way to communicate from starter gui to server script service

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?

Use a RemoteEvent for client - server communcation

1 Like

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.

1 Like

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)
1 Like

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.

1 Like