Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Trying to check if a player has this badge? FIXED

Asked by
ItsMeKlc 235 Moderation Voter
9 years ago

FIXED Unlike UserHasPass(), UserHasBadge checks the player's userId, not the actual player object.

Trying to check if a player has a certain badge. But its not working... Does anybody know why not? output says: Unable to cast instance to int

wait(2) 


badgeId  = 236025088 




GPS = game:GetService("BadgeService")
function respawned(char)
local player = game.Players:FindFirstChild(char.Name)
if char:FindFirstChild("Head") ~= nil then
print("It's a Player!")
if GPS:UserHasBadge(player, badgeId) then
print("Has GPID")      
for i=1,100 do
    print("MLG")
end
else
print("No Ba")
end
end
end
game.Workspace.ChildAdded:connect(respawned)


0
If you feel like this question no longer has any purpose, you can find a 'delete' button on the right. Perci1 4988 — 9y

Answer this question