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

How Can I Create A Vip List For A DearkHeart?

Asked by
jacobwow 140
10 years ago

I mean by this is something like this: VIP = {"someguy", "Anotherperson", Onemoreguy"} and then have it like game.Lighting.Dearkheart:Clone() = player.Startergear So my friends and i can all have dearkhearts and no one else can in the game.

2 answers

Log in to vote
0
Answered by
Link43758 175
10 years ago
local vipAccess = {"someguy", "Anotherperson", Onemoreguy"}
game.Players.PlayerAdded:connect(function(plr)
    for i,v in pairs(vipAccess) do
        if plr.Name == v then
            game.Lighting.Dearkheart:Clone().Parent = plr.Backpack
        else
            print("player is not in VIP list")
        end
    end
end)
Ad
Log in to vote
0
Answered by
Ekkoh 635 Moderation Voter
10 years ago

Or a more efficient version that will let them keep the Darkheart after they die-

local VIP = { ["jacobwow"] = true, ["ekkoh"] = true }
-- I'd recommend putting it in ServerStorage rather than Lighting 
local Tool = Game:GetService("ServerStorage"):WaitForChild("Darkheart")

Game:GetService("Players").PlayerAdded:connect(function(plr)
    if VIP[plr.Name:lower()] == true then
        Tool:Clone().Parent = plr.Backpack
        Tool:Clone().Parent = plr.StarterGear
    end
end)

Answer this question