Why won’t this work? Gives no error and also doesn’t print clicked.
local player = game.Players.LocalPlayer
local x2Stone = game.StarterGui.GamepassButton.GamepassFrame.ScrollingFrame.x2Stone
local marketPlaceService = game:GetService("MarketplaceService")
local gamePassId = 111451515
local exitButton = game.StarterGui.GamepassButton.GamepassFrame.ExitButton
local gamePassButton = game.StarterGui.GamepassButton.Frame.TextButton
gamePassButton.MouseButton1Click:Connect(function()
print("Clicked")
if game.StarterGui.GamepassButton.GamepassFrame.Visible == true then
game.StarterGui.GamepassButton.GamepassFrame.Visible = false
else
game.StarterGui.GamepassButton.GamepassFrame.Visible = true
end
end)
local player = game.Players.LocalPlayer
local marketPlaceService = game:GetService("MarketplaceService")
local gamePassId = 111451515
local exitButton = player:WaitForChild("PlayerGui"):WaitForChild("GamepassFrame"):WaitForChild("ExitButton")
local gamePassButton = player:WaitForChild("PlayerGui"):WaitForChild("GamepassButton"):WaitForChild("Frame"):WaitForChild("TextButton")
local GamepassGui = player:WaitForChild("PlayerGui"):WaitForChild("GamepassGui")
gamePassButton.MouseButton1Click:Connect(function()
if GamepassGui.Enabled == true then
GamepassGui.Enabled = false
else
GamepassGui.Enabled = true
end
end)
local player = game.Players.LocalPlayer
local x2Stone = player.PlayerGui:WaitForChild("GamepassButton").GamepassFrame.ScrollingFrame.x2Stone
local marketPlaceService = game:GetService("MarketplaceService")
local gamePassId = 111451515
local gamepassButton = player.PlayerGui:WaitForChild("GamepassButton")
local exitButton = gamepassButton.GamepassFrame.ExitButton
local gamePassButton = gamepassButton.Frame.TextButton
gamePassButton.Activated:Connect(function()
print("Clicked")
gamepassButton.GamepassFrame.Visible = not gamepassButton.GamepassFrame.Visible
end)