Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

(Still Up) Can anybody point out the error in this personal radio game pass script?

local frame = game.StarterGui.Radio.Frame
local input = frame.Input
local play = frame.Play
local stop = frame.Stop
local gamepassId = 8088654

local players = game:GetService("Players") -- the player service
local marketService = game:GetService("MarketplaceService")

local player = players.LocalPlayer -- In client sided code, you use players.LocalPlayer to get the player


script.Parent.MouseButton1Click:Connect(function()
    -- UserOwnsGamePassAsync takes the UserId as parameter instead of the player instance like previously

     if(marketService:UserOwnsGamePassAsync(player.UserId, gamepassId) then
     	   frame.Visible = true 
			play.Selectable = true
			stop.Selectable = true
			input.Selectable = true
        -- do your thing
else
	print("Pass not found")
  end
 
    end
end)

This script is supposed to put a personal radio GUI on the screen if you have a game pass. It's supposed to make the radio's frame turn visible and the buttons turn visible and selectable when the player has the game pass. It should be relatively simple.

As far as I could tell, I set it up correctly. An error occurs under "then" when I try to run it. Does anybody know how to patch it?

2 comments

0

whats the error?

0

ahh i see

2 answers

I have asked a question similar to this before, see if you can get any help from this.

Click Me

The answer is called a Typo.... yes its a typo.....

At line 16 after if you put a Bracket if(.... Simply Remove the bracket and its fixed!

This discussion is preserved as it was. New answers, comments, and votes are closed.