|
| 09 Feb 2015 07:49 AM |
I am making this game where when you hit something with a car, it becomes unanchored. When Im testing this, its not making anything unanchored, or in the 2nd script, explode. The car is grouped, and so the bumper is in the grouped car. Is that whats making it not work?
Script 1 function onTouched(hit) if hit.Parent.Name == "Bumper" then local a = Instance.new("Explosion") a.BlastPressure = 100 -- the pressure a.BlastRadius = 10 --the radius a.Position = script.Parent.Position a.Parent = game.Workspace end end
Script 2 function onTouched(hit) if hit.Parent.Name == "Bumper" then script.Parent.Anchored = false script.remove() end end
|
|
|
| Report Abuse |
|
|
QuestLog
|
  |
| Joined: 21 Nov 2009 |
| Total Posts: 74 |
|
|
| 09 Feb 2015 08:03 AM |
You got a connect?
"PART TO BE TOUCHED".Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 08:31 AM |
| Ok thanks, Ill see if that works. |
|
|
| Report Abuse |
|
|
| |
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 09 Feb 2015 08:43 AM |
script.Parent.Touched:connect(function() if hit.Parent.Name == "Bumper" then local a = Instance.new("Explosion") a.BlastPressure = 100 -- the pressure a.BlastRadius = 10 --the radius a.Position = script.Parent.Position a.Parent = game.Workspace end put it inside block |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 09:01 AM |
See this script: http://www.roblox.com/Car-that-shreks-walls-item?id=214359602 |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2015 09:35 AM |
| Ok guys, I got it working! I followed your model scripts @above. Thanks everyone! |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 10 Feb 2015 08:48 AM |
| correction, Ok guys I got it working, from luminak who accually knows what scripting is and doesn't just try anything that makes no sense. |
|
|
| Report Abuse |
|
|
| |
|
Egzekiel
|
  |
| Joined: 10 Jan 2011 |
| Total Posts: 1079 |
|
|
| 10 Feb 2015 10:42 AM |
If you do a normal function like function onTouched(hit) end Then you got to connect it with "part".Touched:connect(onTouched) If you know you won't need to repeat the function the do an "Anonymous Function" "part".Touched:connect(function(hit) end) |
|
|
| Report Abuse |
|
|