generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

dealing damage not working

Previous Thread :: Next Thread 
Alimegacorn is online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
13 May 2017 08:34 PM
this is to do damage, but it just plays the animation, and does 0 damage

local attackanimation = script.Parent.Parent.AttackAnimation
local attackanimtrack = script.Parent.Parent.Humanoid:LoadAnimation(attackanimation)
local attackanimdebounce = script.Parent.Parent.AttackValue.Value

script.Parent.Touched:connect(function(object)
if attackanimdebounce == true and object.Parent:FindFirstChild("Humanoid") then
object.Parent:FindFirstChild("Humanoid").Health = object.Parent:FindFirstChild("Humanoid") - 10
attackanimtrack:Play()
script.Parent.Parent.Humanoid.WalkSpeed = 0
attackanimdebounce = false
wait(2)
script.Parent.Parent.Humanoid.WalkSpeed = 16
attackanimdebounce = true
end
end)
Report Abuse
pexf is not online. pexf
Joined: 02 Nov 2013
Total Posts: 1195
13 May 2017 09:01 PM
you forgot to put .Health after ("Humanoid") on this line

object.Parent:FindFirstChild("Humanoid") - 10




Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
13 May 2017 09:12 PM
just use TakeDamage(10)?


"Got my cup of Coffee"
Report Abuse
Alimegacorn is online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
14 May 2017 04:43 PM
ok thanks guys
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image