Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago
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?

0
whats the error? Luka_Gaming07 534 — 4y
0
ahh i see Luka_Gaming07 534 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

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

Click Me

Ad
Log in to vote
0
Answered by 4 years ago

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!

Answer this question