I'm working on this game and if you buy a certain gamepass a gui button will show up on the side of your screen (clicking it will result in a popup gui that allows you to choose your chat color) The only problem is I have tried, several times, to get the button to show up and it hasn't(and yes, I did also try it in a server yet it still failed). Here is what I have so far, a word of warning I am an extremely novice scripter :)
The script is under ServerScriptStorage and it reads :
local id = 6328358 game.Players.PlayerAdded:connect(function(player) if local HasPass = Game:GetService("GamePassService"):PlayerHasPass(player, id) then player.PlayerGui:WaitForChild("ColorGui").Enabled = true end end)
I am currently a nub to answering with code blocks. Basically my version uses MarketplaceService instead of GamePassService for GamePass Ids
local MPS= game:GetService("MarketplaceService") local AssetId = 4661048 function playeradded(player) local GPCheck = MPS:UserOwnsGamePassAsync(player.UserId,AssetId) if GPCheck==true then print(player.Name .. " owns the game pass with ID " .. gamePassID) end end
I figured it out! Here is the setup I have: A script under Server Script Service that reads
local mps = game:GetService("MarketplaceService")
local gamepass = 6328358
script.ColorGui.ResetOnSpawn = false game.Players.PlayerAdded:Connect(function(player) while true do if mps:UserOwnsGamePassAsync(player.UserId,gamepass) then script.ColorGui:Clone().Parent = player.PlayerGui end wait(5) end end)
Inside it is my gui set to enabled, and I have tested it this works in studio and in game.I tested it with an alt too so only if you have the gamepass it will show up!