Hey developers,
I have gamepass script in Serverscriptservice that basically just parents a button to a gui, the gui does is parented to a Replicated storage folder.
Another script will parent the gui from the Replicated storage folder to the Playergui but, the problem is that when the gui is parented to Playergui the button won’t be parented to the gui.
Here is the script (in serverscriptservice)
local mps = game:GetService("MarketplaceService")
local gamepassid = 21391533
game.Players.PlayerAdded:Connect(function(player)
if mps:UserOwnsGamePassAsync(player.UserId, gamepassid) then
script.shop:Clone().Parent = player.PlayerGui:WaitForChild("MainGui").Background
script.exclusive:Clone().Parent = player.PlayerGui:WaitForChild("MainGui").Background.Shop.Frame
else
script.button:Clone().Parent = player.PlayerGui:WaitForChild("MainGui").Background.Shop.Frame
end
end)
game.ReplicatedStorage.GuiPurchasedEXCLUSIVE.OnServerEvent:Connect(function(player)
script.shop:Clone().Parent = player.PlayerGui:WaitForChild("MainGui").Background
script.exclusive:Clone().Parent = player.PlayerGui:WaitForChild("MainGui").Background.Shop.Frame
end)
Help is appreciated!