I want a vehicle to only be accessible to users with a specific badge. However, the script in question produces multiple errors when the seat is used.

I have tried looking for solutions on the developer hub, the DevForum, and even YouTube. Unfortunately, I was unable to find anything particularly useful on either of these platforms.
The script is written as follows, and it is placed within the VehicleSeat. It was originally a Game Pass detection script, which worked quite well.
local badgeId = 2124644447
local BadgeService = game:GetService("BadgeService")
local PlayersService = game:GetService("Players")
function isAuthenticated(player)
return BadgeService:UserHasBadgeAsync()(player.UserId, badgeId)
end
script.Parent.ChildAdded:Connect(function(obj)
if obj.Part1.Name ~= "HumanoidRootPart" then return end
local plr = PlayersService:GetPlayerFromCharacter(obj.Part1.Parent)
print(string.format("%s attempted to operate Transperceneige.", plr.Name, script.Parent.Parent.Name))
if plr and not isAuthenticated(plr) then
script.Parent.Disabled = true
wait(1)
script.Parent.Disabled = false
print(string.format("%s is not authorized to operate Transperceneige.", plr.Name))
end
end)
Any and all help is much appreciated!
