I'm trying to make a combat system and I just discovered that other players' Punching also turns to true when only one player presses Q even without the others actually pressing the key.
Damage Script:
leftPunching = true
wait(1)
leftPunching = false
leftFist.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid and leftPunching then
if not debounce then
debounce = true
humanoid:TakeDamage(10)
wait(.5)
debounce = false
end
end
end)
game.ReplicatedStorage.RemoteLP.OnServerEvent:Connect(leftPunch)
Client:
if input.KeyCode == Enum.KeyCode.Q then
leftKickTrack:Play()
game.ReplicatedStorage.RemoteLK:FireServer()
end
Please see https://scriptinghelpers.org/questions/118763/bool-not-turning-true-locally for more info. Thanks!
