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: How do you connect stuff to a new created part.

Previous Thread :: Next Thread 
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Mar 2013 11:28 PM
I have a hopperbin, when clicked it makes 3-5 new parts.
I can't figure out how to make it so that if you touch them, you become infected.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
31 Mar 2013 11:29 PM
Could you post the code? Though it would be something like:

    local Part = Instance.new("Part", Workspace)
    
    Part.Touched:connect(function() end)

(╯°□°)> KMXD
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Mar 2013 11:33 PM
Accept my party invite knight, I'll show you.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
31 Mar 2013 11:34 PM
It's getting late, and I might have to go soon. Just post any questions here in case I go, so others can assist.

(╯°□°)> KMXD
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Mar 2013 11:36 PM
Ok, my question is, how do you access a players team and change it to a different color with a Script
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
31 Mar 2013 11:36 PM
Player.TeamColor = BrickColor.new("Bright red")

(╯°□°)> KMXD
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Mar 2013 11:37 PM
So far I have this.
function chngtm(part)
h = part.Parent:FindFirstChild("TeamColor")
if h ~= nil then
h = BrickColor.new("Dark green")

end
end

script.Parent.Touched:connect(chngtm)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
31 Mar 2013 11:39 PM
To get the player in this case, you should use the GetPlayerFromCharacter() method. There, you can change the TeamColor.

    function chngtm(part)
    local Player = Game.Players:GetPlayerFromCharacter(part.Parent)
      if Player then
        Player.TeamColor = BrickColor.new("Dark green")
      end
    end
    script.Parent.Touched:connect(chngtm)

(╯°□°)> KMXD
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Mar 2013 11:54 PM
Thanks
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