FunguyI
|
  |
| Joined: 11 Sep 2009 |
| Total Posts: 1412 |
|
|
| 06 Feb 2012 06:58 PM |
I can easily make a lava brick but I want a script that will insert a brick, and kill the player when this brick is touched, without breaking, kinda like a lava brick. Idon't konw what's wrong, I get no error in the output window, the lava just does not work.
local part = Instance.new('Part', Workspace) part.Anchored = true part.Touched:connect(function() function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then h.Health = 0 end end
end) |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 06 Feb 2012 07:05 PM |
script.Parent.Touched:connect(function(hit) human = hit.Parent:findFirstChild("Humanoid") if human then human.Parent:BreakJoints() wait(0.5) part = Instance.new("Part, workspace) part.Anchored = true end end) |
|
|
| Report Abuse |
|
|
FunguyI
|
  |
| Joined: 11 Sep 2009 |
| Total Posts: 1412 |
|
|
| 06 Feb 2012 07:07 PM |
| That was not the answerI was looking for. I was asking how you make all that happens >>OUTSIDE<< the brick, not under it. I wanna the script to be a child of workspace, insert a brick, and make a player die everytime the brick is touched, I will toy with it some more. |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 06 Feb 2012 07:09 PM |
| I don't get what you're saying.. :l |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2012 07:09 PM |
Wait, what "brick"? Touch a brick to insert one..? Please explain.
† KMXD † |
|
|
| Report Abuse |
|
|
FunguyI
|
  |
| Joined: 11 Sep 2009 |
| Total Posts: 1412 |
|
|
| 06 Feb 2012 07:13 PM |
Insert>Script , insert hte script as a cihld of workspace, write the script to insert a brick wit hcertain properties, and to kill somebody every itme they touch that brick, but the csirpt does that while functioning outside the brick, as in, the script's parent is not the brick, i the script's parent is workspace.
local part = Instance.new('Part', game.Workspace) part.Anchored = true part.Touched:connect(function() function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then h.Health = 0 end end
end) |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 06 Feb 2012 07:17 PM |
Ok, so you mean like use a script for a brick but the script is a child of workspace and not the brick?
part = game.Workspace:findFirstChild("PARTNAMEHERE")
part.Touched:connect(function(hit) human = hit.Parent:findFirstChild("Humanoid") if human then human.Parent:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2012 07:18 PM |
Oh looky, Two broke the joints of a character this time. :3
† KMXD † |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
| |
|
FunguyI
|
  |
| Joined: 11 Sep 2009 |
| Total Posts: 1412 |
|
|
| 06 Feb 2012 07:23 PM |
| THank you but i don't want to break the joints,I want to break their health. I think I could try a new approach. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2012 07:23 PM |
Break their heal.. Dude, both will kill you.
† KMXD † |
|
|
| Report Abuse |
|
|
FunguyI
|
  |
| Joined: 11 Sep 2009 |
| Total Posts: 1412 |
|
|
| 06 Feb 2012 07:27 PM |
| Yes, but what if a vehicle or something touches it with the break joints on there? CRUNCH |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2012 07:30 PM |
This already would prevent that.
human = hit.Parent:findFirstChild("Humanoid") if human then
† KMXD † |
|
|
| Report Abuse |
|
|