Making a friend boost system

Hi. I am currently trying to make a friend boost system that works like so:

  • If you have a friend in the same server as you, you get a +10% boost.
  • If you have a friend in the game but that isn’t in the same server as you, you get a +5% boost.
  • If you are following someone that is in the game and this person follows you back, you get a +5% boost.
  • If you are following someone that doesn’t follow you back, you get a +2.5% boost.

I have no idea where to even start to make this, I have a text label already done and this script:

local TextLabel = script.Parent
local Players = game:GetService("Players")

local function updateFriendsCount()
	local FriendsInServer = 0
	local FriendsInGame = 0
	local FollowBackInGame = 0
	local NoFollowBackInGame = 0

	local boostPercentage = (10 * FriendsInServer) + (5 * FriendsInGame) + (5 * FollowBackInGame) + (2.5 * NoFollowBackInGame)
	
	local labelText = string.format("You are currently boosted by +%d%% (click '?' for more info)", boostPercentage)
	TextLabel.Text = labelText
end

updateFriendsCount()
Players.LocalPlayer.FriendStatusChanged:Connect(updateFriendsCount)

Can anyone help me with this please? Thanks!

I suggest searching on youtube “roblox studio friends boost” lot of tutorials appear.

https://www.youtube.com/results?search_query=roblox+studio+friends+boost

1 Like

To detect a friend that joined in the same server as you, it would be simply checking for players joining the server, and getting all players to see who they are friend with in the same server.

For a friend that joins into the game but not in the same server, it would require the knowledge of MessagingService; it is a service that allows you to communicate with other scripts in all servers.

1 Like

Okay, thanks for this reply but do you have any idea on how I could detect someone that the player follows in the same server?

I don’t think you can detect if someone followed you, unfortunately.

1 Like

Why is it so complicated? How about you just stick to how many of your friends are in the same server? This will be the least confusing for your players. There’s some methods of players you can use to check if two people are friends with each other.

1 Like

I know that this is really complicated but this is for one of my projects. I want to make a really big community based game and, not gonna lie with the following feature, lots of people will just farm followers which attracts a lot of kids in the game. I know I can simply make a friend based boost but that’s not my objective xD