You can write your topic however you want, but you need to answer these questions:
-
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. -
What is the issue? Include screenshots / videos if possible!
The GUI only clones for the first premium player that joins the game. -
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! (Gamepassframe is defined.)