So here's my script right so you press L and you do the jab and the once it hits if u stand in-front of the player they take damage on your screen but on the other players screen they do no take any damage. the script is placed in local player.

local Player = game.Players.LocalPlayer

local Mouse = Player:GetMouse()

local dmg = true

Mouse.KeyDown:connect(function(key)

if key == "l" then -- change f to button to activate punch

local an = script.Parent.Humanoid:LoadAnimation(script.Animation)

an:Play()

script.Parent.RightHand.Touched:connect(function(hit)

if hit.Parent.Humanoid and dmg == true then

hit.Parent.Humanoid:TakeDamage(5) -- change 20 to amount of damage

dmg = false

wait(1)

dmg = true

end

end)

end

end)

3 comments

0

Damage on the client is not saved to the server.

0

In other words, use a RemoteEvent.