|
Can anyone help me fix this issue with the scripting?
local adminModule = {};
adminModule.administrators = { Player1 = true; UgandaPizzaPolice = true; UgandaPizzaPolice2 = true; UgandaPPolice = true; etc = true; };
adminModule.IsAdmin = function(table, user)
if (table(newUser)) then
return true;
end; end;
return adminModule; |
|
|
Oh yea here's the other script also:
local Settings = require(Workspace.AdminSettings);
local Gui = game.ServerStorage.UgandaAdminGui
game:GetService("Players").PlayerAdded:connect(function(newUser)
if Settings.IsAdmin(Settings.Administrators, newUser) then
Gui:Clone().Parent = newUser:WaitForChild("PlayerGui")
end
end) |
|
|
Just going to bump this thread |
|
bibo5oJoin Date: 2009-01-17 Post Count: 414 |
More background info? How are these scripts connected? |
|
GeodesicJoin Date: 2013-06-02 Post Count: 998 |
if (table[newUser]) then |
|
|
@bibbo
The script with the "if (table[newUser]) then" is a module script that basically tells the main script which player is an admin or not. The main script is suppose to copy a gui that's inside of ServerStorage and move to the selected "administrators". |
|
bibo5oJoin Date: 2009-01-17 Post Count: 414 |
Geodesic got it. To get a certain item in a list you use square brackets [], not normal or curly, () {}.
eg table[1] |
|
|
Here's a model just to look into it if you don't get what I'm trying to say:
http://www.roblox.com/Ugandas-Admin-Gui-v0-5-Pre-Alpha-item?id=167396219 |
|
|
Hold on, let me test it out. |
|
|
It still not working.
Here's what the server console says:
http(:)//prntscr(.)com/44n0jk |
|
GeodesicJoin Date: 2013-06-02 Post Count: 998 |
if Settings.IsAdmin(Settings.administrators --[[the 'a' in administrators isn't capitalised in your modulescript]], newUser) then
|
|
|
Still giving me the same problem. |
|
|
bibo5oJoin Date: 2009-01-17 Post Count: 414 |
Alright, I messed around with it in studio for a bit and I couldn't get it to work the way you're trying to do it
However, I got it to work like this
local Settings = require(Workspace.AdminSettings);
local Gui = game.ServerStorage.UgandaAdminGui
game:GetService("Players").PlayerAdded:connect(function(newUser)
if Settings.IsAdmin(newUser) then
Gui:Clone().Parent = newUser:WaitForChild("PlayerGui")
end
end)
local adminModule = {};
adminModule.administrators = {"Player1";"UgandaPizzaPolice";"UgandaPizzaPolice2";"SkySpell";"SkySpellALT";};
adminModule.IsAdmin = function(user)
string = table.concat(adminModule.administrators)
if string.find(string,user.Name) then
return true;
end; end;
return adminModule; |
|
|
Alright, going to test them out |
|
|
Oh my god, thank you so much!
It works! |
|
bibo5oJoin Date: 2009-01-17 Post Count: 414 |
np, c: |
|
|
Your credits have been given to properly. |
|