Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago
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

Log in to vote
-1
Answered by
haba_nero 386 Moderation Voter
4 years ago
Edited 4 years ago

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
0
Why the down vote? This 100% works! haba_nero 386 — 4y
0
where do i put the script? robloxs_gamemaker 13 — 4y
0
Just make it a normal script and put it in ServerScriptService haba_nero 386 — 4y
0
it does not work :( robloxs_gamemaker 13 — 4y
View all comments (6 more)
0
the "end" in line 13 is red robloxs_gamemaker 13 — 4y
0
That usually means to delete an end or add a ) to the last end haba_nero 386 — 4y
0
i did those did not work robloxs_gamemaker 13 — 4y
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. haba_nero 386 — 4y
0
ok thanks it works now robloxs_gamemaker 13 — 4y
0
Yw :) haba_nero 386 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
Local Script doesn't work in Workspace AnasBahauddin1978 715 — 4y
0
I think he meant put it inside the starter gui royaltoe 5144 — 4y
0
Yeah sorry. PrismaticFruits 842 — 4y
0
where does the gui go? robloxs_gamemaker 13 — 4y
View all comments (3 more)
0
does it go in the script? robloxs_gamemaker 13 — 4y
0
Yes. PrismaticFruits 842 — 4y
0
But be aware that when a player dies the GUI will reset. PrismaticFruits 842 — 4y

Answer this question