It's supposed to do damage when an enemy touches"hs" or "hss"
01 | hs.Touched:connect( function (dmg) -- if you touch this |
02 | hss.Touched:connect( function (dmg) -- or this it does 10 damage but it no do that :c |
03 | if dmg.Parent:FindFirstChild( "Humanoid" )~ = nil then |
04 | if dmg.Parent.Name ~ = plr.Name then |
05 | dmg.Parent.Humanoid:TakeDamage( 10 ) |
06 | hs:Remove() |
07 | hss:Remove() |
08 | end |
09 | end |
10 | end ) |
11 | end ) |
You need to define hs and hss. That is also called making a variable
Example:
1 | Baseplate = game.Workspace.Baseplate |
For more info on variable visit
http://wiki.roblox.com/index.php?title=Variable
Well, assuming that all the variables are not nil (are defined) then this should work perfectly fine. I'm not 100% sure why your original script did not work, but I have an idea. Oh well, try this:
01 | hs.Touched:connect( function (dmg) -- if you touch this |
02 | if dmg.Parent:FindFirstChild( "Humanoid" )~ = nil then |
03 | dmg.Parent.Humanoid:TakeDamage( 10 ) |
04 | hs:Remove() |
05 | hss:Remove() |
06 | end |
07 | end ) |
08 | hss.Touched:connect( function (dmg) |
09 | if dmg.Parent:FindFirstChild( "Humanoid" )~ = nil then |
10 | dmg.Parent.Humanoid:TakeDamage( 10 ) |
11 | hs:Remove() |
12 | hss:Remove() |
13 | end |
14 | end ) |
Oh and please, could you use code indentation next time for making it easier for people to read your script (I hope this doesn't sound like I'm acting aggressive towards you)? Thank you.