Premium GUI only appears for the first premium player

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I want every premium player that joins the game to get this GUI frame to appear on their screen.

  2. What is the issue? Include screenshots / videos if possible!
    The GUI only clones for the first premium player that joins the game.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve look on the Developer Hub but there is nothing in the output so I don’t know why it doesn’t work. I tried :FireAllClients but that only added another premium frame to first player.

local Prem = game.ReplicatedStorage.events.Prem

game:GetService("Players").PlayerAdded:Connect(function(player)
	if player.MembershipType == Enum.MembershipType.Premium then
		print('A premium player has joined!')
		Prem:FireClient(player)
	end
end)
--ServerScriptService
local prem = game.ReplicatedStorage.events.Prem

local PremFrame = game.ReplicatedStorage.GUIS.Gamepass.Prem.EFX

local function Premium()
	print('owns')
	local cloned  = PremFrame:Clone()
	wait(0.25)
	cloned.Parent = gamepassframe
	cloned.ZIndex = 2
	cloned.Visible = true
	cloned.Name = 'EFX'
end


prem.OnClientEvent:Connect(Premium)
--local script in the Player's GUI

Edit: Any help is realty appreciated! :smiley: (Gamepassframe is defined.)

4 Likes

I’m not entirely sure if this will change anything but try using game.Players instead of game:GetService(“Players”)

That will not do anything at all.

1 Like

That wouldn’t change anything, but thanks for trying!

guis don’t have any business being in replicatedstorage. try moving it to the gui and toggling .Visible depending on the player’s premium membership.

1 Like

Try parenting this script to StarterPlayerScripts. Also, ensure you use game:GetService(‘ReplicatedStorage’) in case that service doesn’t exist for some reason.

Alright I will try this out. Thank you.

1 Like

I ended up putting the GUI folder in StarterGUI and instead checking if the player was premium on the server, I did so on the local client. This seemed to solve the problem.

2 Likes

This is actually a very interesting idea, I think you’re the first to come up with this.