Hello there, im making a script thats supposed to check every players specific values in playergui, if all of them are correct / working. it gives all the players a badge and kicks them. but for some reason the script doesn't work, I'm guessing its the script checking all the values but i have no idea
Script (The Run Context Is Server)
local badgeservice = game:GetService("BadgeService")
local id = 2142031533 --put badge id here
while task.wait() do
for _, plr in ipairs(game:GetService('Players'):GetChildren()) do
if plr.PlayerTasks.Frame.music.Value.Value >= 250
and plr.PlayerTasks.Frame.cook.Value.Value >= 4
and plr.PlayerTasks.Frame.download.Value.Value >= 100
and plr.PlayerTasks.Frame.upload.Value.Value >= 100
and plr.PlayerTasks.Frame.tap.Value.Value >= 1
and plr.PlayerTasks.Frame.tv.Value.Value >= 85 then
local plrid = plr.UserID
badgeservice:AwardBadge(plrid,id)
plr:Kick("You Won The Game!!!")
end
end
end

1 comment
i had to add playergui but it worked!