|
| 20 Jul 2013 09:24 AM |
owners = {"OpenedWattle"}
function isPlayerOwner(name) for i,v in pairs (owners) do if newPlayer.Name == v then return true end end end
function playerJoined(newPlayer) if isPlayerOwner(newPlayer.Name) then newPlayer.TeamColor = BrickColor.new("Bright blue") end end
game.Players.PlayerAdded:connect(isPlayerOwner) |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 09:34 AM |
What exactly is the goal of this script? What is the error saying and on which line? Give us more information for us to be able to help you.
◄◄Join TriF Corporation for Building, Scripting, Designing, and more! http://www.roblox.com/My/Groups.aspx?gid=910626 ►► |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 Jul 2013 09:59 AM |
@COD You can easily see what this is supposed to do by looking. It wasn't an overly complicated script to read. .-.
@OP You called the wrong function with your connection line. Also, I enjoy returning false when it's not true. After the loop, you can do this.
owners = {"OpenedWattle"}
function isPlayerOwner(name) for i,v in pairs(owners) do if newPlayer.Name == v then return true end end return false end
function playerJoined(newPlayer) if isPlayerOwner(newPlayer.Name) then newPlayer.TeamColor = BrickColor.new("Bright blue") end end
game.Players.PlayerAdded:connect(playerJoined) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 Jul 2013 10:00 AM |
Oi. I didn't catch that. xD Change 'newPlayer.Name' in the isPlayerOwner function to 'name', which you set as the parameter.
if newPlayer.Name == v then to if name == v then |
|
|
| Report Abuse |
|
|