Looks like you already have the event so I won't waste your time telling you where to put it.
To begin with, when an event is fired from the server it goes to the client Script -> LocalScript. That being said, when fired from the client it goes to the server LocalScript -> Script.
Judging by line 1 I am guessing that this is a localscript, so what you need to do is fire the event from the client and pick it up on a separate and server sided script. Just remember, localscripts only run on the client and nobody else can see the effects of them, while normal scripts run on the server where everyone can see.
The line of code you'll need for the localscript posted:
remoteEvent:FireServer()
-- Explanation: --
When you fire to the server, you can pass certain variables through, but the simple thing I forget to add all the time when teaching people about events, is the fact that the player is ALREADY being passed by default, and does not to be put in manually.
The line of code you'll need for the server script, where you should place all code:
game.ReplicatedStorage.forcebrr.OnServerEvent:Connect(function(Player)
-- Explanation: --
(Keep in mind there are a few flaws I will point out now)
In the above line I did not include a end), so please apply that.
Any code in the server script, when inside that function, will run for every player to see when the event is fired from the client.
If you have any questions or concerns comment, if this helped or worked accept my answer. Have a great day!
3 comments
Thank you very much, I think it worked! I will test it with my friends right now and see if it works.
:)
If it works, then you can mark it as answered, so you and him get points.