Got bored and figured, why not. This shows the GUI only to indicated userIds and is meant for public use and editing.
That image is pretty cool.
Since Iâm lazy, can you explain how you do it? Chances are you might be doing it a bad way (that is - it might be easily fooled)
Are you talking about the secret GUI or the image? Guessing GUI soâŚ
It basically changes the value of a NumberValue to the LocalPlayers userId. Then it checks to see if the Id matches the designated id(s). If it does, it will make it visible in this version. Simple script though.
[quote] Are you talking about the secret GUI or the image? Guessing GUI soâŚ
It basically changes the value of a NumberValue to the LocalPlayers userId. Then it checks to see if the Id matches the designated id(s). If it does, it will make it visible in this version. Simple script though.
[/quote]
Why does it need to do it so many times? userId doesnât change. While loops should rarely be used like that at that rate
Also, 0 evaluates to true, so it would display for everybody
I think this is what you were trying to write:
local player = game:GetService("Players").LocalPlayer
local userId = player.userId
if userId == 16212258 or (userId <= 0 and player.Name == "Player1") then
script.Parent.Frame.Visible = true
end
local player = game:GetService("Players").LocalPlayer
local userId = player.userId
script.Parent.Frame.Visible = (userId == 16212258 or (userId <= 0 and player.Name == "Player1"))
Also use [ code ] [ /code ] tags instead of posting screenshots
If youâre feeling even more fancy, do that server-side. And then clone the GUI into the playerâs PlayerGui if they are the right player.
That way the GUI doesnât even exist in memory for players unless the server gives them it.
--[[
Hide it | ServerSide
========================================
]]
-- Settings
local Admins = {0}
local NAME_GUI = 'AdminGui'
local function isAdmin(Player)
for _,v in pairs(Admins) do
if Player.userId == v then
return true
end
end
return false
end
-- Hook our Events up
local function Connect(Player)
Player.CharacterAdded:connect(function(Char)
if isAdmin(Player) then
if not Player.PlayerGui:findFirstChild(NAME_GUI) then
ServerStorage[NAME_GUI]:Clone().Parent = Player.PlayerGui
end
end
end)
end
Game:GetService('Players').PlayerAdded:connect(function(NewPlayer)
Connect(NewPlayer)
end)
for _, v in pairs(Game:GetService('Players'):GetChildren()) do
Connect(v)
end
@Crazyman32, that was my initial idea, however I figured that for newer players the current method is easier for their development. Meant to be very easy to edit. Working on a couple ideas and updates for it too.
@Juraan, Great ideas, going to incorporate this.
Umm⌠lol yeah that was way inefficient and easily exploited, good job some other guys wrote quick examples.
Quite constructive as always.
Anyhow, thank you OP. Youâve given me a wonderful idea â Iâm currently on/off working on server control commands, and Iâll make sure to build permission-specific GUI distribution into it
[quote] Quite constructive as always.
[/quote]
Plz donât, itâs Christmas.
I actually made something really cool like this recently. By requiring a ModuleScript, it returns a simple function. With this, I can then execute the function in the Moudle from another script with a specified key and privileged player. If the key matches the key of a table, and the playerâs userId is located in the players table within that table, only then will it return what you want. Otherwise, the only difference is it virtually doesnât exist to outside users. The only down side to this is that it only works in games online.
[quote] @Crazyman32, that was my initial idea, however I figured that for newer players the current method is easier for their development. Meant to be very easy to edit. Working on a couple ideas and updates for it too.
@Juraan, Great ideas, going to incorporate this. [/quote]
This forum isnât really for ânewer playersâ at all.
At first, a lot of users were let into RBXDev without any filters attached. Now, itâs a lot more difficult to get in. So, there are some ânewerâ members, though most arenât.
I meant that the newer players on ROBLOX site can have a hard time understanding LUA when theyâve never seen it before. Not newer RBXDev members,