When I attack the other player, the other player gains pins and I don't. I want the other player to gain pins when he's attacking me and I want to gain pins when I'm attacking him. Are there any problems on this script? Thanks! ~ BlackHatRBX
local CanDamagePlayers = true
script.Parent.Blade.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and CanDamagePlayers == true and hit.Parent.Humanoid.Health > 1 then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local pins = plr:WaitForChild("leaderstats").Pins
pins.Value = pins.Value + 15
hit.Parent.Humanoid:TakeDamage(script.Parent.Damage.Value)
script.Parent.Sound:Play()
hit.Parent.Humanoid.PlatformStand = true
CanDamagePlayers = false
wait(0.5)
CanDamagePlayers = true
wait(1)
hit.Parent.Humanoid.PlatformStand = false
end
end)

5 comments
Well, I think what's going on its since you're holding the tool it is touching you, which means whoever attacks will also get pins. Try checking if the hit.Name ~= tool.Parent..Parent.Name (which is the player who is holding the weopon.
In what line?
It is locating the player its hitting for the variable par not the local player
I ment variable plr sorry
In what line in number though?