Okay so, I have made a working teleport gui that I intend to make only usable for a gamepass called "Fast Travel". I have made this script here that seems to not be working.
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local id = 5068130 local hasPass = false game.Players.PlayerAdded:connect(function(player) if hasPass == MarketplaceService:UserOwnsGamePassAsync(player.userId, id) then player:findFirstChild("PlayerGui").FastTravel.Enabled = true player:findFirstChild("PlayerGui").FakeTravel.Enabled = false else player:findFirstChild("PlayerGui").FakeTravel.Enabled = true end end)
There are 2 guis that this script is supposed to manipulate. "FastTravel" is the working teleport gui that I want to only be enabled for people with the gamepass. "FakeTravel" is the gui that has an identical open/close button to FastTravel, that I use as a placeholder for people without the pass so the spot does not look empty. For example, someone without the pass would have the placeholder button that does nothing, people with the pass will have the working gui entirely. For some reason the placeholder button is there 100% of the time, gamepass or not, and it is making it hard to continue on to my other gamepasses because of this. By default I have FastTravel disabled and FakeTravel Enabled. Both FastTravel and FakeTravel are ScreenGUI's. The Script is located in ServerScriptService.