generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Add name to Adminlist table not working.

Previous Thread :: Next Thread 
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 09:34 AM
I can't get the following code to work. I am trying to make it so that when a person joins who is above rank X in group Y they will be assigned admin. If anyone can help me get this working it will be a great help.



local group = 39977
local rank = 10

adminlist = {"Opplo","UCAF"}

bannedlist = { }


local Plyrs = game:GetService("Players")

function onPlayerAdded(player)
if player:IsInGroup(group)==true and player:GetRankInGroup(group)>=rank then
table.insert(namelist, player.Name)
end

Plyrs.PlayerAdded:connect(onPlayerAdded)
end
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
12 Apr 2015 09:36 AM
local group = 39977
local rank = 10

adminlist = {"Opplo","UCAF"}

bannedlist = { }

game.Players.PlayerAdded:connect(function(player)
if player:GetRankInGroup(group)>=rank then
table.insert(adminlist, player.Name)
end
end)


--//You had it table.insert(namelist, player.Name) rather than: table.insert(adminlist, player.Name)
Report Abuse
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 09:47 AM
I had tried this and the admin still does not work. Thanks for spotting the error with the name of the table I listed, I tried the namelist rather than admin list table to see if it would work if I set users are temporary admins rather than added them to the main admins list.
The Script Analysis does not highlight any errors with the script as it is.
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
12 Apr 2015 09:50 AM
You have to make sure the function that actually tracks their .Chatted is called after you add them to the table.
Report Abuse
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 09:57 AM
So I from what your saying, I need to refresh the following every time that some someone joins the game?


function PERSON299(name)
for i =1,#adminlist do
if adminlist[i] == name then
return true
end end
return false
end
Report Abuse
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 10:02 AM
Sorry for delayed replies, my internet is loosing connection every few mins for some reason.
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
12 Apr 2015 10:07 AM
No, there should be something somewhere where it says:
player.Chatted:connect(commandFunctionParsingHere)

You have to make sure that's added after you insert them into the admin table.
Report Abuse
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 10:13 AM
The code at the top in my first post is at the very top on lines 1 to 12 of the script.
Report Abuse
firelordofengland is not online. firelordofengland
Joined: 22 Dec 2008
Total Posts: 145
12 Apr 2015 10:17 AM
I did a search in the program for "player.Chatted:connect" which came up with zero results, I am currently checking the program by eye for any lines of code that serve the same purpose.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image