I have a Radio gamepass that I am trying to modernize. It is a older fashioned script and I wanted to update and ran into a problem.
I receive no errors but I don't seem to have the radio at all
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamePassID =
local function onPlayerAdded(parent, childName)
assert(parent, "ERROR: WaitForChild: parent is nil")
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
game.Players.PlayerAdded:connect(function(player)
local MarketplaceService = game:GetService('MarketplaceService')
local PlayersService = game:GetService('Players')
local GamePassIdObject = onPlayerAdded(script, 'gamePassId')
player.CharacterAdded:connect(function(char)
if player.Character.Name == "" or MarketplaceService:UserOwnsGamePassAsync (player.UserId, gamePassID) then
require(game:GetService("ReplicatedStorage"):WaitForChild("GiveRadio"))(player)
end end)
end)
Thanks in advance!

1 comment
You should update your question not post this as an answer. If this is solved then add [Solved] to the question title.