zeninja
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 96 |
|
|
| 08 May 2012 08:55 PM |
This script is activated when a block is touched and it changes the color of a spawn location to the color of that player's team. When the spawn location chnages teams it shows a message and then changes the colors of various objects related to the teams. This script needs to be able to distinguish who touches it. If a person on the same team as the spawn touches the spawn location then nothing happens. --That is good. If a person on a different team touches the spawn then the spawn will change teams to the player's team.----Good. The problem with this script is that it does not work :( . Please help me fix it.
Sensor = script.Parent.Parent.SpawnLocation function Capture(hit) if hit.Parent:findFirstChild("Humanoid") ~=nil then name=hit.Parent shirtC=game.Players:GetPlayerFromCharacter(name).TeamColor if shirtC == BrickColor.new("Bright Blue") and Sensor.TeamColor== BrickColor.new("Bright Red") or Sensor.TeamColor== BrickColor.new("White") then local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "CP3 has been taken by the Blues" wait(2) m:Remove() Sensor.TeamColor=shirtC Sensor.BrickColor=shirtC Sensor.Parent.Flag.BrickColor=shirtC Sensor.Parent.BodyMaker.BrickColor=shirtC elseif shirtC== BrickColor.new("Bright Red") and Sensor.TeamColor== BrickColor.new("Bright Blue") or Sensor.TeamColor== BrickColor.new("White") then local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "CP3 has been taken by the Reds" wait(2) m:Remove() Sensor.TeamColor=shirtC Sensor.BrickColor=shirtC Sensor.Parent.Flag.BrickColor=shirtC Sensor.Parent.BodyMaker.BrickColor=shirtC end end end Sensor.Touched:connect(Capture) |
|
|
| Report Abuse |
|
|
zeninja
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 96 |
|
|
| 09 May 2012 03:00 PM |
| Scripters I need your help! |
|
|
| Report Abuse |
|
|
|
| 09 May 2012 03:04 PM |
There are several Captureable Flags in the Catalog. Make one of them do what you want to do.
|
|
|
| Report Abuse |
|
|
zeninja
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 96 |
|
|
| 09 May 2012 03:41 PM |
| It's not that simple. The spawn location is capturable. This script is meant to show a message when someone captures it. To make sure that the message doesn't show up when the same team as the spawn location steps on the spawn some more scripting is needed to ensure that. The rest of the script works except the check of the player's team. |
|
|
| Report Abuse |
|
|
|
| 09 May 2012 03:55 PM |
Yeah,
and the capturable Flags have to handle tha also. So disect it, and see how it does.
|
|
|
| Report Abuse |
|
|
zeninja
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 96 |
|
|
| 10 May 2012 08:56 PM |
I tired this script and nothing happened.
Sensor = script.Parent.Parent.SpawnLocation function Capture(hit) if hit.Parent:findFirstChild("Humanoid") ~=nil then name=hit.Parent shirtC=game.Players:GetPlayerFromCharacter(name).TeamColor if shirtC == BrickColor.new("Bright Blue") and Sensor.TeamColor~=BrickColor.new("Bright Blue") then local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "CP3 has been taken by the Blues" wait(2) m:Remove() Sensor.TeamColor=shirtC Sensor.BrickColor=shirtC Sensor.Parent.Flag.BrickColor=shirtC Sensor.Parent.BodyMaker.BrickColor=shirtC elseif shirtC== BrickColor.new("Bright Red") and Sensor.TeamColor~=BrickColor.new("Bright Red") then local m = Instance.new("Message") m.Parent = game.Workspace m.Text = "CP3 has been taken by the Reds" wait(2) m:Remove() Sensor.TeamColor=shirtC Sensor.BrickColor=shirtC Sensor.Parent.Flag.BrickColor=shirtC Sensor.Parent.BodyMaker.BrickColor=shirtC end end end Sensor.Touched:connect(Capture)
Please help! |
|
|
| Report Abuse |
|
|
zeninja
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 96 |
|
| |
|