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
 

Re: Does anyone have a reliable damage script or can help mine?

Previous Thread :: Next Thread 
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
20 Jan 2017 09:36 PM
local animation = Instance.new("Animation")

animation.AnimationId = "http://www.roblox.com/Asset?ID=613286590"

debounce = false


script.Parent.Activated:connect(function(activated)
local player = game.Players.LocalPlayer
local Humanoid = player.Character.Humanoid
if script.Combatting.Value == false then
script.Disabled = false
script.Combatting.Value = true
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
wait(0.5)
animTrack:Stop()
wait(1)
script.Combatting.Value = false
script.Parent.Tip.Touched:connect(function(onTouched)
local humanoid = onTouched.Parent:FindFirstChild("Humanoid")
if debounce == true then return end
debounce = true
if humanoid then
humanoid:TakeDamage(3)
debounce = false
end
end)
end
end)

I'm not sure if I used debounce correctly in this, because it still does WAY more than 3 damage when it touches an object with a humanoid.


| >๏๓คгเђєг๏< | Beginner Developer
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
20 Jan 2017 09:39 PM
bump


| >๏๓คгเђєг๏< | Beginner Developer
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
20 Jan 2017 09:45 PM
ahhhh


| >๏๓คгเђєг๏< | Beginner Developer
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
20 Jan 2017 09:54 PM
ugh


| >๏๓คгเђєг๏< | Beginner Developer
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
20 Jan 2017 09:55 PM
if it does way more than 3 damage, then you are probably not using debounce properly, as you should wait after every touched event to whatever is being touched.
Report Abuse
OmariHero is not online. OmariHero
Joined: 14 Aug 2013
Total Posts: 4193
20 Jan 2017 09:58 PM
Thanks, that worked.


| >๏๓คгเђєг๏< | Beginner Developer
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