local frame = script.Parent
local httpService = game:GetService('HttpService')
local template = script.Parent:WaitForChild('Template')
local tableOfPlayers = game.ReplicatedStorage.Values.TableOfPlayers
local decoded = httpService:JSONDecode(tableOfPlayers.Value)
local inRound = game.ReplicatedStorage.Values.InRound
local function checkForTable(table_, value)
for i, v in pairs(table_) do
if v == value then
return true
else
return false
end
end
end
inRound.Changed:Connect(function()
if inRound.Value == false then
script.Parent.Visible = false
else
script.Parent.Visible = true
end
end)
local cor = coroutine.create(function()
while true do
for i, plr in pairs(game.Players:GetPlayers()) do
if checkForTable(decoded, plr.Name) and plr.ListedOnHealth.Value == false then
local newTemp = template:Clone()
newTemp.Name = plr.Name
newTemp.Visible = true
newTemp.Parent = table
elseif not checkForTable(decoded, plr.Name) and plr.ListedOnHealth == true then
local frame = script.Parent:FindFirstChild(plr.Name)
frame:Destroy()
end
end
print(decoded)
wait(0.01)
end
end)
coroutine.resume(cor)
I can't find the problem. Any help would be appreciated. this is a local script

1 comment
Did you test it in studio