Two problems:
If they don't have the game pass if gives duplicates of the regular GUI (Every 5 seconds). This is obnoxious because my GUI has moving parts. How do I make it only give one?
How would I remove the regular GUI if they buy the game pass while in game? The script only gives one VIP gui if you join the game with the pass. But I imagine if they buy the pass in game it will have the VIP gui and and regular gui.
Thank you for any help you guys may provide. Here's what I have so far:
Explorer:
Server Script Service
Script
RegularGui
VIPGui
Script:
local mps = game:GetService("MarketplaceService")
local gamepass = #########
script.VIPGui.ResetOnSpawn = false
script.RegularGui.ResetOnSpawn = false
game.Players.PlayerAdded:Connect(function(player)
while true do
if mps:UserOwnsGamePassAsync(player.UserId, gamepass) then
script.VIPGui:Clone().Parent = player.PlayerGui
--***********LINE TO REMOVE REGULAR GUI********************
else
script.RegularGui:Clone().Parent = player.PlayerGui
end
wait(5)
end
end)

1 comment
Why are you running a loop at line 6?