|
| 24 Sep 2011 10:05 AM |
Okay, heres what I want.
. The person named (Me) To be killed by the brick on touch.
. The damage to be full, (Max damage)
heres the script
-Function OnHumanoidTouch(konichiwah89) <-- I want it to damage me only.
local humanoid.Maxdamage <-- I want this part ot kill me.
end end |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 10:05 AM |
I want this part "To" Kill me
Typo, My bad. |
|
|
| Report Abuse |
|
|
nike6330
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 154 |
|
|
| 24 Sep 2011 10:07 AM |
function Touch(part) if part.Parent.Name == "YourName" then part.Parent:findFirstChild("Humanoid"):TakeDamage(damage) end end script.Parent.Touched:connect(Touch)
..I think that was hidden request hmm |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 10:08 AM |
Well, isn't this the script requesting area?
I'm only a beginner at scripting, D= |
|
|
| Report Abuse |
|
|
|
| 24 Sep 2011 10:08 AM |
function onTouch(hit) p = game.Players if p.Name == ("konichiwah89") then hit.Parent.Humanoid.Health = 0 end
script.Parent.Touched:connect(onTouch)
That should work.But i'm not completley sure.
|
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 24 Sep 2011 10:09 AM |
I'm not a fan of requests..
However, this is quite easy.
local db = true local targ = "konichiwah89" script.Parent.Touched:connect(function(h) if not db then return end db = false if h.Name ~= targ then return end h:BreakJoints() wait(2) db = true end) |
|
|
| Report Abuse |
|
|
Ender1234
|
  |
| Joined: 21 May 2011 |
| Total Posts: 28 |
|
|
| 24 Sep 2011 10:09 AM |
You should try something like this:
function onTouched(hit) if (hit.Parent.Humanoid ~= nil) and (hit.Parent.Name == "konichiwah89") then hn = hit.Parent:FindFirstChild("Humanoid") hn.Health = --desired health level here-- else return end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 24 Sep 2011 10:09 AM |
Gah, h.Parent..
local db = true local targ = "konichiwah89" script.Parent.Touched:connect(function(h) if not db then return end db = false if h.Parent.Name ~= targ then return end h.Parent:BreakJoints() wait(2) db = true end) |
|
|
| Report Abuse |
|
|