|
| 13 Apr 2014 10:36 AM |
| I'm making a game about smashing things. The problem is that when I use a tool to hit something that is stationary, it won't do anything. But when I move the tool around while I hit the object, like move my character side to side, it damages the object as intended. Is there any explanation to this? |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
| |
|
|
| 13 Apr 2014 11:35 AM |
enabled = true
function onTouched(h) if enabled == true then if h.Name == "PUTIS" then if h.Transparency ~= 1 then enabled = false h.Parent.Humanoid.Health = h.Parent.Humanoid.Health - 25 wait(1) enabled = true end end end end
script.Parent.Touched:connect(onTouched)
Backround: The object's name is PUTIS. The script is in a part in a tool. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 13 Apr 2014 03:01 PM |
script.Parent.Touched:connect(function(p) if p.Parent.ClassName == "Tool" then script.Parent.BrickHealth.Health = 0 end end)
inside the brick if a tool touches it boosh |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| 13 Apr 2014 10:02 PM |
I thought this was scripting helpers.
b12 |
|
|
| Report Abuse |
|
|
2unknown2
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 9351 |
|
|
| 13 Apr 2014 10:20 PM |
enabled = true
script.Parent.Touched:connect(function(h) if enabled == true and h and h.Parent:findFirstChild("Humanoid") then if h.Name == "PUTIS" then if h.Transparency ~= 1 then enabled = false h.Parent.Humanoid.Health = h.Parent.Humanoid.Health - 25 wait(1) enabled = true end end end end)
|
|
|
| Report Abuse |
|
|
|
| 13 Apr 2014 10:35 PM |
| Yea, that didn't work either. I'm beginning to think that this isn't a scripting error but an error on ROBLOX's part. |
|
|
| Report Abuse |
|
|
2unknown2
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 9351 |
|
|
| 13 Apr 2014 10:36 PM |
| make a join.me or something so i can see full thing |
|
|
| Report Abuse |
|
|
|
| 13 Apr 2014 10:41 PM |
| join.me? Never heard of it |
|
|
| Report Abuse |
|
|
2unknown2
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 9351 |
|
|
| 13 Apr 2014 10:42 PM |
its like a screen share thing
just go to
join.me |
|
|
| Report Abuse |
|
|