I’m making a party system that allows the owner to toggle if it’s friends only or not. Seems simple right?
Well, I’m using the function game.Players.LocalPlayer:IsFriendsWith()
but it just never works no matter what I do.
I’ve already checked out DevForum posts about this same issue and their solutions never work for me.
Here’s the important code:
if FriendsOnly.Value and game.Players.LocalPlayer:IsFriendsWith(game.Players[PartyOwner].UserId) then
JoinParty()
elseif not FriendsOnly.Value then
JoinParty()
end
FriendsOnly is a boolean that represents if a party is set to friends only or not.
The PartyOwner variable represents this: local PartyOwner = script.Parent.Parent.Name:split("-")[1]
Basically the Party frame is named the Owner’s Name then the Party Number (such as, the 4th party created by XXXTMS would be “XXXTMS-4”)
It’s set in string form (as shown by :split())