|
| 02 Aug 2013 12:41 PM |
I am trying to make a script that changes the owners team when he joins in the game. What's wrong with it? Here is what I have:
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(playerJoined) |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 02 Aug 2013 12:43 PM |
| Output? What happens? Does it put all to that team? or not work? |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:45 PM |
| The output says nothing and it really doesn't do anything... |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:47 PM |
1. newPlayer isn't defined in the isPlayerOwner function 2. The playeradded event doesn't work half the time in solo mode. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:48 PM |
| I don't run it in solo mode. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:49 PM |
| If you tested this online, you would have gotten the output saying newPlayer is a nil value or something of the sort. Because it didn't post anything, I assumed you ran it in solo mode. |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 02 Aug 2013 12:51 PM |
repeat local p=game.Players.PlayerAdded:wait()until p.userId==game.creatorId p.TeamColor=BrickColor.new'Bright blue' |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 02 Aug 2013 12:52 PM |
repeat p=game.Players.PlayerAdded:wait()until p.userId==game.creatorId p.TeamColor=BrickColor.new'Bright blue'
get rid o dat local |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:54 PM |
| Explain how that works and where it goes please. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:56 PM |
| @ilikeyou that'd only work one time though o-o |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 02 Aug 2013 01:00 PM |
game.Players.PlayerAdded:connect(function(p) if p.userId==game.creatorId then p.TeamColor=BrickColor.new'Bright blue' end end)
fine uHappy im not :l |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 01:04 PM |
| whynot? you have dem awsum scripting skillz |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 02 Aug 2013 01:08 PM |
| cus i cant come up with any ideas on what to script Dx |
|
|
| Report Abuse |
|
|