koolboy27
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 934 |
|
|
| 08 Nov 2012 08:06 PM |
I'm trying to create a script that when the player touches a brick called "Base"; the TeamColor of the player becomes the BrickColor of a brick called "Flag". I created this script although it is not working:
local flag = game.Workspace.Flag function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") flag.BrickColor == humanoid.Parent.TeamColor end
The error message is: Workspace.Base.Script:4: '=' expected near '==' I am a beginner scripter and I just tried to take some parts of a lava script and adjust it but I'm sure it's way wrong. Thank you for the help though! -Koolboy27 |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
| |
|
Exobyte
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 386 |
|
|
| 08 Nov 2012 08:10 PM |
flag.BrickColor = hit.Parent:getPlayerFromCharacter().TeamColor
Tell me if that works, I'm not 100% positive. |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 08 Nov 2012 08:12 PM |
| oh only read error thing, use his |
|
|
| Report Abuse |
|
|
koolboy27
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 934 |
|
|
| 08 Nov 2012 08:15 PM |
| Exobyte i noticed the "hit" in your script. Should I change the second line to function onTouch(hit)? |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 08:15 PM |
flag.BrickColor = Game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 08:16 PM |
@kool
Yes, or change his/my hit to part.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 08 Nov 2012 08:18 PM |
im bad at reading :'C.......
|
|
|
| Report Abuse |
|
|
koolboy27
|
  |
| Joined: 23 Aug 2009 |
| Total Posts: 934 |
|
|
| 08 Nov 2012 08:25 PM |
| Thank you guys so much it works! :D |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 08:29 PM |
You're welcome. :D
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|