Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Punch Script broken (Damage over time without punching) how do i fix this?

Asked by 5 years ago

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)

0
Damage on the client is not saved to the server. DeceptiveCaster 3761 — 5y
0
In other words, use a RemoteEvent. DeceptiveCaster 3761 — 5y
0

Answer this question