Could someone help me make my attack script stop damageing?
Asked by
7 years ago Edited 7 years ago
Here is the script
its not the best but it my try at it im kinda in experienced
This is my full script i tried my best
01 | local animation = Instance.new( "Animation" ) |
04 | Player = game.Players.LocalPlayer |
05 | mouse = Player:GetMouse() |
07 | local Player = game.Players.LocalPlayer |
09 | local Character = Player.Character |
11 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
13 | local Animation = Instance.new( "Animation" ) |
16 | if damage.Parent:FindFirstChild( "Humanoid" ) and damage.Parent.Name ~ = |
18 | damage.Parent.Humanoid.Health = damage.Parent.Humanoid.Health - 1 |
22 | local Player = game.Players.LocalPlayer |
23 | local Mouse = Player:GetMouse() |
26 | local CanDamage = true |
27 | local CanDamage = false |
30 | Mouse.KeyDown:connect( function (key) |
31 | if key:lower() = = "q" then |
32 | local character = Player.Character |
33 | animTrack = character:WaitForChild( "Humanoid" ):LoadAnimation(animation) |
35 | Player.Character [ "Left Arm" ] .Touched:connect(Hit) |
36 | local CanDamage = false |