local function WaitForChild(parent, childName)
assert(parent, "ERROR: WaitForChild: parent is nil")
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local GamePassService = game:GetService('GamePassService')
local PlayersService = game:GetService('Players')
local GamePassIdObject = WaitForChild(script, 'GamePassId')
local function OnPlayerAdded(player)
if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
if player then
local PlayerGui = WaitForChild(player, 'PlayerGui')
local Gui = PlayerGui.SpecialEffectsGui
Gui.FireButton.Visible = true
Gui.SmokeButton.Visible = true
Gui.SparklesButton.Visible = true
end
end
end
PlayersService.PlayerAdded:connect(OnPlayerAdded)
No error or warning, located in LocalScript via StarterGui.
