Problem: I keep having this error
It keeps saying something about UserID, and how player dosent exist.
I honestly have no idea what is going on.
local part= script.Parent
local Players = game:GetService("Players")
local badgeService = game:GetService("BadgeService")
local function GiveBadge(CharacterPart)
local CharacterModel = CharacterPart.Parent
local player = Players:GetPlayerFromCharacter(CharacterModel)
if badgeService:UserHasBadgeAsync(player.UserId, 3475182492337699) == true then
--Do Nothing
else
badgeService:AwardBadge(player.UserId, 3475182492337699)
end
end
part.Touched:Connect(GiveBadge)