How can I get this local script that I used for non filtering enabled many months ago and turn it into a working script for filtering enabled. I understand I have to use RemoteServer for FE but this script clones a PlayerButton of every single player in the server and goes back and forth between the 2 selected players as they take turns selecting players for their team; thus, making this a nightmare to figure out how to get around Filtering Enabled.
--------------------------------------------
sp = script.Parent
guiteam = sp.Parent.Team
capfol = workspace.CaptainFolder
folteam = capfol.Turn
sp.MouseButton1Click:connect(function()
if guiteam.Value == folteam.Value then
if game.Players:FindFirstChild(sp.Text) ~= nil then
print "PLAYER EXISTS"
local playa = game.Players:FindFirstChild(sp.Text)
if playa.Team.Name == "Spectators" then
if folteam.Value == "Home" then
folteam.Value = "Away"
else
folteam.Value = "Home"
end
for index, child in pairs(game.Teams:GetChildren()) do
print"LOOPING"
if child.TeamColor.Name == "Bright red" and guiteam.Value == "Away" then
print"I WENT AWAY"
playa.Team = child
end
if child.TeamColor.Name == "Bright blue" and guiteam.Value == "Home" then
print"I WENT HOME"
playa.Team = child
end
end
end
end
wait()
sp:Remove()
end
end) |