Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Friends only spawn without use of a team?

1 answer

local friendId = 0 --replace

local friendSpawnPos = workspace.friendSpawn.Position --replace

local isFriendsCache = setmetatable({}, {__index = function(self, i)
	self[i] = game:GetService("Players")[i]:IsFriendsWith(friendId)
	return self[i]
end})

game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if isFriendsCache[plr.Name] then
			char:WaitForChild"HumanoidRootPart".CFrame = CFrame.new(friendSpawnPos)
		end
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.