I've been trying to make a spawn that detects if a player is on your friends list, and then spawns them there if they are. I don't want to utilize teams for this, and have been having trouble without the use of teams. I was wondering if anyone could help me out with this. Thanks
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.

1 comment
http://wiki.roblox.com/index.php?title=API:Class/Player/IsFriendsWith