Lets say as in that example ROBLOX used on the wiki. A player fires a bullet from the Client to the Server well RemoteEvents are only 1 way Events meaning you can only go from Client > Server or Server > Client. Now lets say you fired a bullet but using a RemoteFunction, a RemoteFunction is a 2 way communication meaning you fire the bullet from the Client to the Server and then BACK to the Client to make a check that it actually passed through the server safely then giving the player the point. I hope maybe this helps if not I will give an example!
RemoteEvents & RemoteFunctions are similiar, Both can be used For Server → Client or Client → Server Communication. The only difference is that RemoteFunctions can return values, Meanwhile RemoteEvents can’t.
For example, Let’s say that you have a Shop in your game, Only players with the Level above 10 can buy a certain item, You would need to check the Player’s level on the Server, As doing it on Client wouldn’t work at all. (Exploits, And can easily be bypassed)
You can use RemoteFunctions for that, Since they can return values and you can check them. Here’s what a simple example of them would look like (Assuming there’s a RemoteFunction called “GetLevel” on ReplicatedStorage):
-- Server Script
-- ReplicatedStorage
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GetLevel = ReplicatedStorage:WaitForChild("GetLevel")
-- Main
-- This is gonna fire whenever a Player invokes the Server
-- Let's say when they invoke the RemoteFunction (Client → Server)
-- They're requesting the value.
GetLevel.OnServerInvoke = function(Player)
-- Assuming the Player has a Leaderboard folder...
return Player.Leaderboard.Level.Value
end
-- Client Script
-- ReplicatedStorage
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GetLevel = ReplicatedStorage:WaitForChild("GetLevel")
-- Testing
-- We're gonna request the Server to gives us our Level.
local PlayerLevel = GetLevel:InvokeServer()
if PlayerLevel >= 10 then
-- Code
end