I am trying to make a model that gives a badge to the player that clicked it but I get the error "Userid is not a valid member of Player “Players.smartcarman1"”
Here’s my script:
local ClickDetector = script.Parent.ClickDetector
local badgeservice = game:GetService(“BadgeService”)
local id = 2124746316
When an error like that appears, you likely misspelled something. In this case, you misspelled “Userid”
Since Roblox is case-sensitive, do UserId, notUserid.
Fixed code:
local ClickDetector = script.Parent.ClickDetector
local badgeservice = game:GetService("BadgeService")
local id = 2124746316
ClickDetector.MouseClick:Connect(function(plr)
print("Mouse Clicked!")
badgeservice:AwardBadge(plr.UserId, id)
end)