Ok so I made this skill script the skill works fine but for some reason it does damage to me when I use it so can someone take a look at it and help me? I wanted it to do damage to the other players.
Player = game.Players.LocalPlayer
Char = Player.Character
Torso = Char.Torso
Mouse = Player:GetMouse()
function Move(key)
key = key:lower()
if key == "z" then
print ("z was pressed")
game.Players.LocalPlayer.Character.Torso.Anchored = true
for i = 1, 100, 3 do
Move = Instance.new("Part")
Move.Parent = Workspace
Move.Size = Vector3.new(math.random(4,6), math.random(4,6), math.random(4,6))
Move.Anchored = true
Move.TopSurface = 0
Move.BottomSurface = 0
Move.BrickColor = BrickColor.new("Brown")
Move.CanCollide = false
game.Players.LocalPlayer.Character.Torso.Anchored = false
game.Players.LocalPlayer.Character.Humanoid:TakeDamage(1)
y = Instance.new("BodyVelocity")
y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
y.velocity = Player.Character.Torso.CFrame.lookVector*80
Move.Parent = Workspace
y.Parent = Move
Move.CFrame = Player.Character.Torso.CFrame*CFrame.new (0, 0, -12)*CFrame.new (0,0,-i)CFrame.Angles(math.random(), math.random(), math.random())
wait()
end
end
end
Mouse.KeyDown:connect(Move)

1 comment
I mean I want it to damage the player it's hitting not the one that's using it. When I use the move on a dummy it damages me instead of it. So that's what I needed help with.