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

Why does this GUI's Removing Gamepass Script not work?

Asked by 7 years ago
Edited 7 years ago

What this script is intended to is if you have a gamepass the NewsGui, and Ad (GUI) get destroyed.

would i need to go to the PlayerGui instead?

GPS = game:GetService("GamePassService")
player = game.Players.LocalPlayer
id = 498305418

game.Players.PlayerAdded:connect(function()
    if GPS:PlayerHasPass(player, id) then
        game.StarterGui.NewsGui:Destroy()
        game.StarterGui.Ad:Destroy()
    end
end)

1 answer

Log in to vote
2
Answered by 7 years ago

I do believe you must use PlayerGui as I think everything in StarterGui just gets copied over to PlayerGui.

http://wiki.roblox.com/index.php?title=API:Class/StarterGui

Ad

Answer this question