I am trying to make an admin console for my game, and only want a few players to see the gui button.
I can't create a code, because i ain't really good at scripting...
I am trying to make an admin console for my game, and only want a few players to see the gui button.
I can't create a code, because i ain't really good at scripting...
make this http://imgur.com/a/Cptx1 The Folders inside the script are Configuration
local Tools = script:WaitForChild("Backpack")
local Gui = script:WaitForChild("PlayerGui")
local Body = script:WaitForChild("Character")
local Func = {}
Options = {
Admins = {"Player1", "your name here"};
}
Func.Check = function(What, With)
for i, v in pairs(With) do
if v == What then
return true
end
end
return false
end
Func.CharAdd = function(Char)
local Player = game.Players:GetPlayerFromCharacter(Char)
for i, tools in pairs(Tools:GetChildren()) do
tools:Clone().Parent = Player.Backpack
end
for i, guis in pairs(Gui:GetChildren()) do
guis:Clone().Parent = Player.PlayerGui
end
for i, Items in pairs(Body:GetChildren()) do
Items:Clone().Parent = Player.Character
end
end
Func.PlayerAdd = function(Player)
if Func.Check(Player.Name, Options.Admins) then
Player.CharacterAdded:connect(Func.CharAdd)
end
end
game.Players.PlayerAdded:connect(Func.PlayerAdd)
Thanks! :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Hi there! In my opinion I would HIGHLY recommend you learn to script before doing any coding involving Admin consoles. My recommendation is to learn more about Gui's and go over the "Scripting Series" of the roblox wiki and get to know LUA yourself! Here are some Links that will help you out: http://wiki.roblox.com/index.php?title=AllTutorials , http://wiki.roblox.com/index.php?title=Intro_to_GUIs