Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what should i do? i want to make it that roblox premium members can only see this gui.

local Players = game:GetService("Players")
local player = Players.LocalPlayer
 
if player.MembershipType == Enum.MembershipType.Premium then
	script.MorphGui:Clone().Parent = player.PlayerGui
end

2 answers

✓ Accepted answer

Hello! In order to use this, you need to make a normal script to clone the GUI everytime a player dies. Put the GUI in ServerStorage and name it "PremiumGui"

game.Players.PlayerAdded:Connect(function(player)
	wait(2)
	if player.MembershipType == Enum.MembershipType.Premium then 
        	local clone = game.ServerStorage:FindFirstChild("PremiumGui"):Clone()
        	clone.Parent = player:FindFirstChild("PlayerGui")
		player.Character:FindFirstChild("Humanoid").Died:Conect(function()
			wait(7)
			local clone = game.ServerStorage:FindFirstChild("PremiumGui"):Clone()
        		clone.Parent = player:FindFirstChild("PlayerGui")
			
		end
	
    end
end

EDIT

Put this LOCALSCRIPT inside the GUI and put the GUI in Starter GUI and tick enabled to false in properties

local Player = game.Players.LocalPlayer
if Player.MembershipType = Enum.MembershipType.Premium then
	script.Parent.Enabled = false
end

10 comments

0

Why the down vote? This 100% works!

0

where do i put the script?

0

Just make it a normal script and put it in ServerScriptService

0

it does not work :(

0

the "end" in line 13 is red

0

That usually means to delete an end or add a ) to the last end

0

i did those did not work

0

Ok I am sorry then. I tried to help, but it did not work. I'm sorry. Line 3 should at least help you.

0

ok thanks it works now

0

Yw :)

Put this inside a local script inside StarterGui:

local Players = game:GetService("Players")
local player = Players.LocalPlayer

game.Players.PlayerAdded:Connect(function()
    if player.MembershipType == Enum.MembershipType.Premium then 
         local clone = script.MorphGui:Clone()
         clone.Parent = player.PlayerGui 
    end
end)

It should work.

If this helped please accept this answer.

7 comments

0

Local Script doesn't work in Workspace

0

I think he meant put it inside the starter gui

0

Yeah sorry.

0

where does the gui go?

0

does it go in the script?

0

Yes.

0

But be aware that when a player dies the GUI will reset.

This discussion is preserved as it was. New answers, comments, and votes are closed.