If the user has the badge, they'll be teleported to the next place. If they don't, they will be denied access. I'm lost on what I forgot to add into the script. Any help on this?
BadgeId = 106566897 --Testing Badge
function onTouched(hit)
character = hit.Parent
if character then
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
print("The user has this badge")
print("Teleporting user to next level")
game:GetService("TeleportService"):Teleport(158451458, player)
else
print("The user does not have this badge")
print("Teleport disabled")
end
end
end
