Hello , i am trying to make a anti star glitcher script for a script builder because they are so laggy, but it doesn't seem to work, in the script builder it works only for a player then it doesn't work and when i test it in studio it just doesn't work, it doesn't give errors, why?
function Anti(plr)
repeat wait(1) print("No character") until plr.Character
local Chara = plr.Character
local Total = 0
for i,v in pairs(Chara:GetChildren()) do
if not v:IsA("Accessory") and not v:IsA("Pants") and not v:IsA("BodyColors") and not v:IsA("ForceField") and not v:IsA("Shirt") then
print(v.ClassName)
print("acceeded to")
Total = Total+1
end
end
local endd = false
print(Total)
if Total < 20 then
wait(2)
Chara.ChildAdded:Connect(function(c)
if not endd then
Total = Total+1
print("Child added")
print(Total)
if Total >= 20 and endd == false then
print("gru called.")
endd = true
Gru(plr)
table.insert(GruDebounce, plr.Name)
end
end
end)
elseif not endd and Total >= 20 then
print("Gru called")
Gru(plr)
endd = true
table.insert(GruDebounce, plr.Name)
end
end

3 comments
also, the Anti() is connected when a player joins the game and it also connects when the script gets all the players, the gru function is the function that gives a punishment to the player
and gru kills the player and then calls anti again
also the star glitcher is not a collectible coin, its a script