|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 12 Apr 2015 10:02 AM |
| Sorry for delayed replies, my internet is loosing connection every few mins for some reason. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|