Creating a game on Roblox but a problem I'm having is making sure everyone has a target that isn't themself or someone who already targets them.
Say if you had 4 players assigned targets randomly. I want to prevent this outcome.
Player1 targets Player2
Player2 targets Player3
Player3 targets Player1
Player4 targets Player4
or Player3 targets Player4
Player4 targets Player3
function aFunctionfdfsd()
local targetList = {} -- List of people(3+) who haven't been targeted
while myTarget == Me or myTarget == targetsMe do -- cant be yourself or exchanged
ranPlayer = math.random(1, #targetList)
myTarget = targetList[ranPlayer]
--HELP HERE ?
end
table.remove(targetList, targetList[ranPlayer])
end

2 comments
It like same mode with Roblox Assasin classic mode. Are you try to copy it? :P
just make checks so target name is not equal to the player's name