Added player List

This commit is contained in:
Cooldude2606
2019-09-28 16:17:17 +01:00
parent e2e06552ef
commit d39fd5ab18
9 changed files with 293 additions and 256 deletions

View File

@@ -147,9 +147,9 @@ end
@treturn[2] boolean if the element was found, found
@treturn[2] LuaGuiElement the element that was found
@usage-- Getting the center gui
local exists, center = Gui.find(player,'gui','center')
local exists, center = Gui.exists(player,'gui','center')
]]
function Gui.find(element,...)
function Gui.exists(element,...)
local path = tostring(element.name)
for _,next_element_name in pairs{...} do
if type(next_element_name) == 'table' then
@@ -165,18 +165,22 @@ function Gui.find(element,...)
return true, element
end
--[[-- Checks if a gui element exists or not, returns it if found else the path where it failed
@see Gui.find
--[[-- Checks if a gui element exists or not, if not found will throw an error
@see Gui.exists
@tparam LuaGuiElement element the root element to start checking from
@tparam ?string|table ... element names or element concepts that point to your element
@treturn[1] boolean if the element was found, failed
@treturn[1] string the path of the element that the search stoped at
@treturn[2] boolean if the element was found, found
@treturn[2] LuaGuiElement the element that was found
@treturn LuaGuiElement the element that was found
@usage-- Getting the center gui
local exists, center = Gui.exists(player,'gui','center')
local exists, center = Gui.find(player,'gui','center')
]]
Gui.exists = Gui.find
function Gui.find(element,...)
local exists, element = Gui.exists(element,...)
if not exists then
return error('Could not find element: '..element,2)
else
return element
end
end
--[[-- Toggles the enabled state of an element
@tparam LuaGuiElement element the element that you want to toggle the enabled state of