|
| 18 Jun 2016 05:29 AM |
So I need a script that is inside a brick and it gives the brick health. When the brick has been damaged then it losses health, Then when it has no health it explodes and gets removed, but after a specific time it comes back.
Anyone here willing to help a guy in trouble? :=) |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 18 Jun 2016 05:52 AM |
u either got money
or u r trying to learn and forgot to post ur script
i will do it for 20 robux |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 05:54 AM |
| Check the wiki, there's bound to be a script on this |
|
|
| Report Abuse |
|
|
Leceptor
|
  |
| Joined: 31 Dec 2014 |
| Total Posts: 15979 |
|
| |
|
|
| 18 Jun 2016 06:12 AM |
| @amanda I sent you a message |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Jun 2016 06:14 AM |
| Put a Humanoid in the brick so that you can easily detect damage done to it. This would probably be the simplest solution for you to implement, but there are many other ways you could do this. :) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 06:15 AM |
@Soybeen Then the brick will only lose health (depending on which weapon Im using) and not dissapear
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 06:22 AM |
| I just tested, the brick doesn't even lose health with humanoid :/ |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Jun 2016 06:25 AM |
Well dude, it depends on what you're damaging it with/how xD That's an equally important part to this process |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 06:44 AM |
So you know that exploding barrel free model? So I took those scripts and added it to the wall, and now its working as I want it ;) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2016 09:10 AM |
Ok so I have the wall, the explosion and the health. But I have no regen script Anyone help? |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 01:42 PM |
| http://wiki.roblox.com/index.php?title=How_to_Make_a_Model_Regenerate |
|
|
| Report Abuse |
|
|
Leceptor
|
  |
| Joined: 31 Dec 2014 |
| Total Posts: 15979 |
|
| |
|
calvin56
|
  |
| Joined: 18 May 2007 |
| Total Posts: 784 |
|
|
| 19 Jun 2016 02:38 PM |
this inside the brick:
local h = Instance.new("Humanoid",script.Parent)
function TakeDamage() if h.Health <1 then Instance.new("Explosion",script.Parent) script.Parent.Transparency = 1 script.Parent.CanCollide = false wait(10) --how long until the brick appears again script.Parent.Transparenct = 0 script.Parent.CanCollide = true end
i never tested it so tell me about any errors |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 03:06 PM |
| Calvin, you spelled transparency wrong |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 04:41 PM |
--make 2 scripts and a number value, name the number value HealthBrick and name the brick Enemy
--put this inside 1 of the scripts
local dad = script.Parent local health = dad.HealthBrick.Value while true do if health==0 then dad:remove() --< you can replace this with an explosion end end
--and this in the other script
function onTouch(hit) if hit.Name=="Enemy" then hit.HealthBrick.Value = hit.HealthBrick.Value -1 end end script.Parent.Touched:connect(onTouch)
--I haven't tried it so try this for yourself and see if you like it |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2016 04:44 PM |
#calvin56
the problem with the script you had was that the part would have to be anchored. Instead of making it disappear/transparency-change just make the Parent of the part "Lighting" |
|
|
| Report Abuse |
|
|