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: Help with this script it will not do any damage

Previous Thread :: Next Thread 
KillerTeenGaming is online. KillerTeenGaming
Joined: 10 Dec 2014
Total Posts: 61
22 Sep 2015 01:18 AM
-- (i am new at this, this is a hopperbin tool in starter pack)

player = game.Players.LocalPlayer

m = player:GetMouse()

Punch = script:WaitForChild("Punch")

tool = script.Parent

Rarm = player.Character["Right Arm"]

arm = Rarm

local damage = 5

tool.Selected:connect(function(m)
m.Button1Down:connect(function()
local animateTrack = player.Character.Humanoid:LoadAnimation(Punch)
animateTrack:Play()
end)
end)

arm.Touched:connect(function()
if equipped and character and humaniod and humanoid.Health > 0 and hit and not hit:isDescendantOf(character) then
local targethumaniod = hit.Parent:findFirstChild("Humaniod")
if targethumanoid and targethumanoid.Health > 0 then
targethumaniod:TakeDamage(damage)
end
end
end)
Report Abuse
LilMcManiac is online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
22 Sep 2015 06:02 AM
Honestly instead of using a HopperBin, why don't you use the UserInputService and make the player hit a key on the keyboard for the function to happen?
Report Abuse
Csharp0 is not online. Csharp0
Joined: 05 Mar 2015
Total Posts: 261
22 Sep 2015 06:19 AM
First of all use Tools, they don't require handles anymore.

Is that a localscript?
Report Abuse
Csharp0 is not online. Csharp0
Joined: 05 Mar 2015
Total Posts: 261
22 Sep 2015 06:22 AM
If it isn't a localscript then this will instantly cause it to not work:

player = game.Players.LocalPlayer

If it is a localscript then it shouldn't be because then changes will only happen for the player who runs the script.
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