Nay10Join Date: 2008-06-06 Post Count: 3435 |
Help please.... |
|
BastionGXJoin Date: 2010-02-02 Post Count: 332 |
script.Parent.Touched:connect(function(_o)
pcall(function()
_o.Parent['Humanoid']:TakeDamage(100)
end)
end) |
|
Nay10Join Date: 2008-06-06 Post Count: 3435 |
thx |
|
Xtreme101Join Date: 2009-01-03 Post Count: 4385 |
BastionGX is GOOD. |
|
Nay10Join Date: 2008-06-06 Post Count: 3435 |
ya |
|
LeftAngleJoin Date: 2008-12-24 Post Count: 604 |
DO not give him these little scripts.He uses it For exploiting .... WTH |
|
CardCaddyJoin Date: 2010-01-02 Post Count: 1025 |
function onTouch(part)
if part == nil then
return
end
if part.Parent:FindFirstChild("Humanoid") ~= nil then
humanoid = part.Parent:FindFirstChild("Humanoid")
humanoid:TakeDamage(humanoid.Health)
end
end
script.Parent.Touched:connect(onTouch)
Mine might be easyer to understand if you wana learn somethin from it... |
|
|
This is the correct. All the other noobs posted the wrong script!
function onTouched (hit)
local h = findFirstChild("Humanoid")
if (h ~= nil) then
humanoid.Health = 0
end
end
script.Parent.Touched:connect (onTouched)
There... |
|
CardCaddyJoin Date: 2010-01-02 Post Count: 1025 |
Thats not right... "local h = findFirstChild("Humanoid")"? Yeah... umm... not gona work. Just use mine. |
|
NinezaJoin Date: 2009-11-22 Post Count: 2153 |
Tuffy, don't say they posted the wrong thing if they didn't. If you don't understand the script, don't assume it doesn't work. They're using more advanced scripting than the basic method to make it easier. |
|
H1998Join Date: 2009-03-30 Post Count: 3336 |
Tuffy, Not correct. Your script is supposed to be:
function onTouched (hit)
local h = hit.Parent:findFirstChild("Humanoid") -- It must find child of somethin
if h ~= nil then return end -- something like that
h.Health = 0
end
end
script.Parent.Touched:connect(onTouched) -- No space |
|
NinezaJoin Date: 2009-11-22 Post Count: 2153 |
It doesn't matter about the space.
And I didn't mention about the hit.Parent:findFirstChild("Humanoid") bit because it was already mentioned. =D
Wow. Over 600 posts by me. =D |
|
curt9043Join Date: 2009-01-10 Post Count: 2883 |
function Kill(humanoid)
if humanoid~=nil then
humanoid:TakeDamage(100)
end
end
script.Parent.Touched:connect(function(part)
humanoid = part.Parent:findFirstChild("Humanoid")
Kill(humanoid)
end) |
|
|
You guys make it so complicated. It is as simple as this:
script.Parent.Touched:connect(function(part)
pcall(function()
part.Parent.Humanoid.Health = 0
end)
end) |
|
curt9043Join Date: 2009-01-10 Post Count: 2883 |
I prefer my one, as it is easilly editable. |
|
drblue22Join Date: 2009-10-23 Post Count: 2 |
guys im a total noob at scripting it just seems so complicated i would love it if you guys could give me a few pointers thx Drblue22 |
|
H1998Join Date: 2009-03-30 Post Count: 3336 |
|
|
|
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = 0
end
end
script.Parent.Touched:connect(onTouched) |
|
Script09Join Date: 2009-05-22 Post Count: 549 |
or, you can make a lava brick that 'Dissolves'
function t(h)
hi = h.Parent:FindFirstChild("Humanoid")
if hi~=nil then return end
h.Parent:remove()
end
script.Parent.Touched:connect(t) |
|
H1998Join Date: 2009-03-30 Post Count: 3336 |
Script09, If you use that script the player wont respawn |
|
|
Absolute Kill
function wthomgblah(nose)
humanoid = nose.Parent:findFirstChild("Humanoid")
if humanoid ~= nil then
humanoid.MaxHealth = 0
humanoid.Health = 0
if humanoid.Parent ~= workspace then
humanoid.Parent:BreakJoints()
end
end
end
script.Parent.Touched:connect(wthomgblah) |
|
|
yay finnally the right script |
|
VirtuosaJoin Date: 2010-06-16 Post Count: 44 |
function onTouched (hit) --Function
local h = hit.Parent:findFirstChild("Humanoid") -- Find the humanoid of whatever touched it
if h ~= nil then return end -- if "h" is not present, then keep listening
h.Health = 0 -- if "h" is present, then kill it >:D
end
end
script.Parent.Touched:connect(onTouched)
This is the most common one for this purpose... |
|
ghost3541Join Date: 2009-12-13 Post Count: 16 |
function onTouch(part)
if part == nil then
return
end
if part.Parent:FindFirstChild("Humanoid") ~= nil then
humanoid = part.Parent:FindFirstChild("Humanoid")
humanoid:TakeDamage(humanoid.Health)
end
end
script.Parent.Touched:connect(onTouch)
Derr Ya Goez |
|
|
script.Parent.Touched:connect(function(_o)
pcall(function()
_o.Parent['Humanoid']:TakeDamage(100)
end)
end)
simple.... |
|