|
| 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 |
|
|
|
| 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 |
|
|
|
| 31 Mar 2013 11:33 PM |
| Accept my party invite knight, I'll show you. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 31 Mar 2013 11:36 PM |
Player.TeamColor = BrickColor.new("Bright red")
(╯°□°)> KMXD |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|