What am I supposed to fire back to the client?

Hey so I got this piece of code

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(x, argument)
	for _, v in pairs(game.Players:GetPlayers()) do
		if string.lower(v.Name) == string.lower(argument) then
			game.ReplicatedStorage.RemoteEvent:FireClient()
			print("Found.")
		else  
			warn("Server: Not found.")
		end
	end
end)

Once the v.Name matches with argument, it should fire something back to the client. But what?

Hello. You can return the found name. Depends on how you implement the code. You can also return a boolean. Also I recommend switching to Remote Function.

1 Like