generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Need help with this:

Previous Thread :: Next Thread 
koolboy27 is not online. 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 is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
08 Nov 2012 08:10 PM
== should be =
Report Abuse
Exobyte is not online. 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 is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
08 Nov 2012 08:12 PM
oh only read error thing, use his
Report Abuse
koolboy27 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 08:15 PM
flag.BrickColor = Game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor


¤¤ †KMXD† ¤¤
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 08:16 PM
@kool

Yes, or change his/my hit to part.

¤¤ †KMXD† ¤¤
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
08 Nov 2012 08:18 PM
im bad at reading :'C.......
Report Abuse
koolboy27 is not online. koolboy27
Joined: 23 Aug 2009
Total Posts: 934
08 Nov 2012 08:25 PM
Thank you guys so much it works! :D
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Nov 2012 08:29 PM
You're welcome. :D

¤¤ †KMXD† ¤¤
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image