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

Why wont my gamepass script work?

Asked by 10 years ago

I'm trying to make a script which disables one script and enables another if you have own it. This is what I have:

local gamepassID = 162781083
local pp2 = game.Workspace.FreePP
local pp10 = game.Workspace.MorePP

game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamepassService"):PlayerHasPass(player, gamepassID) then
        print("Has 5x Gamepass")
        pp2.Disabled = true
        pp10.Disabled = false
    else
        print("No 5x Gamepass")
    end
end)

I'm having trouble figuring out why this script won't work, can anyone help?

1 answer

Log in to vote
0
Answered by 10 years ago

Well, mabey you can use destroy() instead of Disabled? Or mabey, you can use remove() or remove.

0
That removed one of the scripts, but then I have to enable the other script still. FierceByte 25 — 10y
Ad

Answer this question