|
| 15 Jun 2014 02:37 AM |
| So with a rocket launcher or a bomb, is it possible to prevent team killing by only allowing the explosions to take damage on the opposing team only? |
|
|
| Report Abuse |
|
|
Swordize
|
  |
| Joined: 03 Jun 2013 |
| Total Posts: 13136 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 15 Jun 2014 06:40 AM |
| I am really stuck now, I don't understand how can I deal the damage and also I was wondering is it possible to make the rocket not explode if it hits a certain part or model? |
|
|
| Report Abuse |
|
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
|
| 15 Jun 2014 06:44 AM |
| I for one would turn the BlastPressure property to 0, use Magnitude to check for nearby players, and check their teamcolor. If it's not your own then it damages. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 06:46 AM |
| I see, how about if I wanted the rocket to not explode on certain parts/models? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 06:47 AM |
I would take a look at editing this example script right here: http://wiki.roblox.com/index.php/Hit_(Event)
Here's my siggy... Done. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 07:17 AM |
| Ohhhhhhh, I see, thanks! I understand a little more! So, if I wanted only players in the opposing team color to get damaged, how would I do that? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 07:21 AM |
Find a way to store the team colour of the person who attacked and then use an if statement to check if the hit player's team colour isn't equal to the attacker's team colour.
Here's my siggy... Done. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 07:22 AM |
| So I would check the target players team color and see if their team color is not equal to yours or maybe even the rocket color? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 07:26 AM |
That's a good idea. Change the rocket's colour to the player's team colour (converted to a brick colour, obviously), then use an if statement to check if the target's team colour (converted to a brick colour) isn't equal to the rocket's brick colour.
http://wiki.roblox.com/index.php?title=BrickColor#Comparing_BrickColors
Example: if rocket.BrickColor.Color ~= target.TeamColor then --Assuming target and rocket are defined.
Here's my siggy... Done. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2014 07:28 AM |
| Ok, thanks! Also this part is confusing to me a little, how can I get a rocket to pass through certain objects that I don't want the rocket to explode? And also how can I get the rockets explosion to destroy models? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 16 Jun 2014 12:34 AM |
Wait, would it work for that if I went like:
function onHit(part) if part.Name == DoNotExplode then return if part.Parent.Name == Explode then part.Parent:BreakJoints() end
Would it work? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 16 Jun 2014 12:41 AM |
Add welds on the models, Maybe add something to where all parts the rocket can go through are named canPass It checks when touching if part is named canPass then it continues, I'd type it up but it's a little much to type out on ipad |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2014 12:42 AM |
| Aww, maybe latter, thanks. |
|
|
| Report Abuse |
|
|