UserHasBadgeAsync: User is invalid or does not exist

What do you want to achieve?
I want to make it teleport the player when they put in a specific combination and have a specific badge for a keypad

What is the issue?
When I press enter, it gives the error: UserHasBadgeAsync: User is invalid or does not exist. And I put the plr.UserId so I have no idea why it says it dosen’t exist

What solutions have you tried so far?
changing the plr to plr.UserId and I have no idea what else to try changing

ts is teleport service
bs is badge service

enter.MouseClick:Connect(function(plr)
	local CurrentInput = display.SurfaceGui.TextLabel.Text
	if tonumber(CurrentInput) == combination and bs:UserHasBadgeAsync(BadgeId, plr.UserId) then
		display.SurfaceGui.TextLabel.Text = "Correct"
		local newcorrectsound = correctsound:Clone()
		newcorrectsound.Parent = enter.Parent
		newcorrectsound:Play()
		wait(0.5)
		door.Transparency = 1
		newcorrectsound:Destroy()
		display.SurfaceGui.TextLabel.Text = ""
		ts:TeleportAsync(PlaceId, {plr})
		wait(1)
		door.Transparency = 0
	end
end)
1 Like

You have the parameters the wrong way. It should be

bs:UserHasBadgeAsync(plr.UserId, BadgeId)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.