digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 12:02 PM |
Table = {}
-- Either:
Table[#Table + 1] = "Hello "
-- Or:
table.insert(Table, "World!")
print(table.concat(Table)) >Hello World! |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 12:03 PM |
| if the table was named somthing else would it work? |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 12:06 PM |
| Just change where I said 'Table' for the name of the table. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 12:07 PM |
so would this script work? admins = {"digpoe", "SpeedBoy123"} function Enter(player) player.Chatted:connect(function(msg) if player.Name == "digpoe" or player.Name == "SpeedBoy123" and msg:sub(1, 6) == "admin/" then table.insert(admins, msg:sub(6)) end end) end
? |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 12:10 PM |
| Yes, it should work, but since you never linked the function 'Enter' to a listening event, it won't do anything at all. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 12:12 PM |
| no the listening event is inside it, and I know it works. I took it from another scripter, that his script works. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 12:14 PM |
| It won't *Facepalm* you used an anonymous function for the chatted event, that's fine, but you didn't with the function Enter ._. IT WON'T DO ANYTHING AT ALL. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 12:15 PM |
heres his full script. I removed the Guest banning bit so i wasn't banned. And i edited the name part:
function Enter(player) if player then local e = Instance.new("Model", game.Lighting.Deleted) e.Name = player.Name local t = Instance.new("IntValue", workspace.Timers) t.Name = player.Name local s = script.Timer:clone() s.Parent = t s.Disabled = false local m = Instance.new("Model", player) m.Name = "Trusted" end player.Chatted:connect(function(msg) if player.Name == "digpoe" and msg:sub(1, 2) == "\\ " then local fn = loadstring(msg:sub(3)) if type(fn) == "function" then Delay(0, fn) end end if msg:lower() == "reset" then pcall(function() player.Character:BreakJoints() end) end if msg:lower() == "fix" then pcall(function() for _, v in ipairs(player.Backpack:GetChildren()) do v:remove() end for _, v in ipairs(game.StarterPack:GetChildren()) do v:clone().Parent = player.Backpack end for _, v in ipairs(player.PlayerGui:GetChildren()) do if not string.find(v.Name:lower(), "health") and not game.StarterGui:findFirstChild(v.Name) then v:remove() end end end) end end) end game.Players.PlayerAdded:connect(Enter)
|
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Sep 2011 12:16 PM |
| Oh then that should work, I though the snippet of code you posted before was the full script. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 01:25 PM |
| One question, how would you access a table in a script from another? |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
| |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 02:10 PM |
| so it would be _Gadmins = {...? |
|
|
| Report Abuse |
|
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 02:17 PM |
Would it be in the declaring part?
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2011 02:19 PM |
if you say
_G.admins = {"name","name2","soandso"}
You are putting a table into the global table. The global table can be accesed by all scripts.
It is like a variable. You have to declare it (like I did above), before you access it in other scripts if you don't want to raise an error. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 10 Sep 2011 04:14 PM |
| so how would I acess it, would I just have to say "admins" in the script to acess it? |
|
|
| Report Abuse |
|
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 09 Oct 2011 06:53 AM |
| would you use _G. for accessing the contents of a global table, in an if statement? |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2011 09:03 PM |
yes you do. Think of _G as a separate table:
_G = {table = {"element1","element2","element3"}}
if _G.table[2]:find("2") then print("yes") else print("no") end
--> yes |
|
|
| Report Abuse |
|
|