Skip to content

Friends

Mistium edited this page Aug 15, 2024 · 2 revisions

The friends system is by far the easiest plug and play friends system that you will find on any scratch extension.

How does it work?

The friends system has 2 arrays for each user, an array of incoming friend requests, and an array of current friends.

You cannot see a list of the friend requests you have sent.

What is "Not Authenticated"

block_15_08_2024-12_32_27

This simply means you haven't logged in yet, When you do login, it will show a list of users on your friends list.

Blocks

Friend List

block_15_08_2024-12_37_16

This returns an array of all the usernames of people in your friends list

Example:

[
  "wow"
]

Remove Friend

block_15_08_2024-12_36_17

This block is pretty self explanatory, it removes the friendship status from both you and the person you unfriended.

Accept Request

block_15_08_2024-12_38_17

This allows you to accept a friend request from a username, adding them to your friends list, and you to theirs

Decline Request

block_15_08_2024-12_39_06

This block allows you to remove a pending friend request from a user

Send Request

block_15_08_2024-12_47_57

This block allows you to send a friend request to another user.

Success

"Sent Successfully"

Failure

Attempted to send a request to someone you are friends with
"Already Friends"

Attempted to send a request to someone you already friend requested
"Already Requested"

Attempted to send a friend request to an account that doesn't exist
"Account Does Not Exist"

Attempted to friend request yourself
"You Need Other Friends :/"

When Request Received

block_15_08_2024-12_56_00

This event block will fire whenever someone else sends you a friend request

When Request Accepted

block_15_08_2024-12_56_37

This event block will fire whenever someone accepts one of your friend requests

Get Requests

block_15_08_2024-12_57_13

This block returns an array of the incoming friend requests to your account

Example:

[
  "constellinux"
]

Friend Status

block_15_08_2024-12_58_15

Put the username of someone in this block and it can output a few different things:

When you are friends with someone
"Friend"

When you have a request from someone
"Requested"

Otherwise
"Not Friend"

Friend Count

block_15_08_2024-13_00_41

This block simply tells you how many friends that you have

Clone this wiki locally