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 I make onhit with brick name die?

Previous Thread :: Next Thread 
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 06:45 PM
Say that like

Two teams

Team1
Team2

For team1

onhit kill1

it would break their joints

if Team2
do nothing

how would that be?


THanks
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 06:46 PM
-Touched event
--GetPlayerFromCharacter
---TeamColor is not what you want
----Kill
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 06:48 PM
Basically what I said xd

I want it so

onTouch(hit)
(i think)
get team somehow
if team == Team1
then
BreakJoints()
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 06:49 PM
No, usually I wouldn't make a script but whatever:

Put this script in the brick

script.Parent.Touched:connect(function(Part)
if not Part or not Part.Parent then return end
local Player = Game.Players:GetPlayerFromCharacter(Part.Parent)
if Player and Player.TeamColor == Game.Teams.IWANTYOUTODIETEAM.TeamColor then
Player.Character:BreakJoints()
end
end)
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 06:50 PM
Thanks, but I want a script in game.Workspace, is that possible?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 06:51 PM
Change script.Parent to
Game.Workspace.BrickName
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 06:51 PM
ty
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 07:13 PM
wait
it uses team color
what if
one = Bright Blue
team1

Other = Deep orange
team2

brick = kill1

would this be the right script then

Game.Workspace.Kill1.Touched:connect(function(Part)
if not Part or not Part.Parent then return end
local Player = Game.Players:GetPlayerFromCharacter(Part.Parent)
if Player and Player.TeamColor == Game.TeamsTeam1.Bright Blue then
Player.Character:BreakJoints()
end
end)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 07:14 PM
No

"Game.TeamsTeam1.Bright Blue"
Is wrong.

Make it:

Game.Teams["Bright Blue"].TeamColor
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 07:16 PM
Okay
Thanks!
So I don't need to have Team1 in there, right?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 07:17 PM
Unless the name is:

Team1Bright Blue
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 07:28 PM
This did not work, Team name Team1, Color Bright blue
part name = Kill1

qq

Game.Workspace.Kill1.Touched:connect(function(Part)
if not Part or not Part.Parent then return end
local Player = Game.Players:GetPlayerFromCharacter(Part.Parent)
if Player and Player.TeamColor == Game.Teams["Bright Blue"].TeamColor then
Player.Character:BreakJoints()
end
end)
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 07:46 PM
bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Sep 2013 07:58 PM
Game.Teams.Team1.TeamColor
Report Abuse
Procedure is not online. Procedure
Joined: 14 Jan 2011
Total Posts: 4884
21 Sep 2013 07:59 PM
Can you show me completed script

I am bad at syntax, there are 2 sections with TeamColor

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