I want to make it so that once a button is clicked, it makes sure the user owns a GamePass and if so, then the main frame/actual GUI pops up and if clicked again, it would go away. But, the GamePass part is already done. My issue here is that it’s not popping up whatsoever. I’ve tried changing positions, changing a few things in my script, yet nothing helped.
This is my script which is in the Open/Close button and it should be able to make the main frame (Base) pop up.
local MPS = game:GetService("MarketplaceService")
local player = game:GetService("Players").LocalPlayer
local userId = player.UserId
local gamepassId = -- My gamepass ID would be here, which I do have in my inventory.
if MPS:UserOwnsGamePassAsync(userId, gamepassId) then
wait(2)
local animframe = script.Parent.Parent.Parent.Base
local move = false
script.Parent.MouseButton1Click:connect(function()
if move == false then
animframe:TweenPosition(UDim2.new({-0.4, 0},{0.645, 0}), "In", "Quad", 1)
move = true
else
animframe:TweenPosition(UDim2.new({0.016, 0},{0.645, 0}), "Out", "Quad", 1)
move = false
end
end)
else
MPS:PromptGamePassPurchase(player, gamepassId)
end
I’ve looked into multiple Devforum posts, and Youtube videos which I expected to help but, it didn’t. I’ve been trying to make this work for a little over a day and yet I can’t find a solution. If you do have an idea of what could be wrong with my script, please inform me and I’ll be able to implement it into my script.