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: Spawn Location Capture

Previous Thread :: Next Thread 
zeninja is not online. 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 is not online. zeninja
Joined: 04 Feb 2009
Total Posts: 96
09 May 2012 03:00 PM
Scripters I need your help!
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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 is not online. 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
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
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 is not online. 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 is not online. zeninja
Joined: 04 Feb 2009
Total Posts: 96
11 May 2012 03:56 PM
Any one?
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