|
| 01 Jan 2012 08:56 AM |
Part=game.Workspace.Part
function onTouch() game.Workspace.JoeLuke001.Humanoid.Health=0
end Part.Touched:connect(onTouch)
It's expected to kill on touch, but it says that my character is no valid part of the Workspace. |
|
|
| Report Abuse |
|
|
Finloe
|
  |
| Joined: 28 Dec 2011 |
| Total Posts: 67 |
|
|
| 01 Jan 2012 08:58 AM |
Humanoid.Health = 0
LOL i think spaces |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 08:59 AM |
| Finloe, you can assign a value without a space. |
|
|
| Report Abuse |
|
|
Finloe
|
  |
| Joined: 28 Dec 2011 |
| Total Posts: 67 |
|
|
| 01 Jan 2012 09:00 AM |
...ive been adding spaces this entire time for no reason...
WHERE HAS MY LIFE GONE D: |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:01 AM |
Part=game.Workspace.Part
function onTouch(hit) if hit.Parent.Name == JoeLuke001 then hit.Parent.Humanoid.Health=0 end end
Part.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:02 AM |
Nope. It also says disconnected event because of exception.
I don't understand scripting to well because I'm still very new to it. |
|
|
| Report Abuse |
|
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:04 AM |
Opps.
Part=game.Workspace.Part
function onTouch(hit) if hit.Parent.Name == "JoeLuke001" then hit.Parent.Humanoid.Health=0 end end
Part.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:05 AM |
| i thought you had to have more ends? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:07 AM |
@Ufail,
Still nothing.
Now nothing is in the Output when I touch the brick. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:08 AM |
@Evanthepancake
You add an end for every if, do, or function. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:11 AM |
| Ugh, it's so simple, yet I can't figure it out. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:17 AM |
| It should work, I even went and tested it. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:20 AM |
Oh. it does work.
It wasn't working in solo. Thanks, Ufail. :) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:21 AM |
But just a question.
Will it only kill me on touch or will it kill everybody? |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 01 Jan 2012 09:23 AM |
local Part=game.Workspace.Part
Part.Touched:connect(function() game.Workspace["JoeLuke001"].Humanoid.Health=0 end) |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:25 AM |
| You wouldn't need brackets around his name since there is no special characters in it. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 01 Jan 2012 09:25 AM |
@JoeLuke001
Only you. If you want it to kill anyone that touched it, here:
local Part=game.Workspace.Part
Part.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health=0 end) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 09:27 AM |
| Thanks, phell. It's working in multiplayer now. :D |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 01 Jan 2012 09:28 AM |
@UFAIL
The brackets replace :FindFirstChild() Plus, his name have numbers. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 01 Jan 2012 09:31 AM |
| Mine worked, a number isn't a special character. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 01 Jan 2012 09:33 AM |
@UFAIL
Yes, because you did it differently. I made it where when anything touch the part, Joe will die.
You made it so Joe would die if he touch it. |
|
|
| Report Abuse |
|
|