xyzqvr
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 14 |
|
|
| 07 Nov 2014 11:04 AM |
ex: speshulplayers = {"xyzqvr"} game.Players.PlayerAdded:connect(function(p) name = p.Name:lower() end)
how do i do it? |
|
|
| Report Abuse |
|
|
xyzqvr
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 14 |
|
| |
|
|
| 07 Nov 2014 11:12 AM |
for i, v in pairs(speshulplayers) do if v == name then print(name .. " is relly speshul") end end
guise i have a siggy |
|
|
| Report Abuse |
|
|
xyzqvr
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 14 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
xyzqvr
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 14 |
|
|
| 07 Nov 2014 11:22 AM |
speshulplayers = {"xyzqvr", "Player"} game.Players.PlayerAdded:connect( function(p) for i, v in pairs(speshulplayers) do print("Comparing "..v.Name.." and "..p.Name) if v:lower() == name:lower() then print(name .. " is relly speshul") script.AdminGui:Clone().Parent = p.PlayerGui end end end )
12:21:30.413 - Workspace.Script:6: attempt to concatenate field 'Name' (a nil value) 12:21:30.413 - Stack Begin 12:21:30.414 - Script 'Workspace.Script', Line 6 12:21:30.414 - Stack End
wtf name is a string value and it's not nil -_- |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 07 Nov 2014 11:31 AM |
^ reffered to me?
for i, v in pairs(speshulplayers) do if v == name then print(name .. " is relly speshul") end end
so basically
A player == a string
?
we need the name.. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Nov 2014 11:33 AM |
| Except for that v is already a string because of the table it came from :P |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 11:36 AM |
local speshulplayers = {"xyzqvr"}
game.Players.PlayerAdded:connect(function(player) local name = string.sub(player.Name) for i, v in pairs(speshulplayers) do if v == name then print(name .. " is relly speshul") end end end)
guise i have a siggy |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 07 Nov 2014 11:36 AM |
| Oh, I thought that des guy (forgot name sowwy :p) ment he needed to get the players, forgot we talked about tables lol |
|
|
| Report Abuse |
|
|
xyzqvr
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 14 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Nov 2014 01:22 PM |
Its more efficent to use a dictionary table though local whiteList = { ["128GB"] = true; [1] = true; } --Don't put quotes if its a userId
local blackList = { [261] = true; ["noob"] = true; }
game.Players.PlayerAdded:connect(function(player) if blackList[player.userId] or blackList[player.Name] and (player.userId ~= game.CreatorId) then player:kick() elseif whiteList[player.userId] or whiteList[player.Name] or (player.userId == game.CreatorId) then player.Chatted:connect(function(input) print(input) end) end end) |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Nov 2014 01:32 PM |
Or, if you're using my helper library
speshulplayers = enum{"A player", "Some other player", ["SomeKey"] = "eLunate"}
print(speshulplayers["A player"]) --> A player print(speshulplayers[2]) --> Some other player print(speshulplayers.SomeKey) --> eLunate print(speshulplayers.eLunate) --> eLunate print(speshulplayers[3]) --> eLunate print(#speshulplayers) --> 3 (Compared to 2, which a normal table would give you)
Also works remarkably fine with ipairs hehe |
|
|
| Report Abuse |
|
|