I’ve very recently started a new project after being inactive for a while and i have made a part which gives a player a badge when they touch it and while the player gets the badge if they touch the part when they already have that badge and join back the part stays for them which it shouldn’t.
I’ve tested it in studio and on the game itself because badges don’t really work with studio but it still doesn’t work and i need this to work for future additions for this part of the script.
Plz help a little poor boy fixing his small bit of code, i also don’t get the print which makes me know that the player or badge just isn’t being detected.
The code
-- Badgeid set in variable
game:GetService("Players").PlayerAdded:Connect(function(plr)
if badgeservice:UserHasBadgeAsync(badgeid) then
print(plr.Name.." had the badge")
script.Parent.CanCollide = false
script.Parent.Transparency = 1
script.Enabled = false
end
end)