How to detect if nothing had damage taken with the :TakeDamage queue

Currently I have been looking up and down the forums and onto other websites and I really can’t find a solution to this, i’m very new to LUA. Simply, how do you detect if you remotefunction didn’t hit another humanoid?

I’ve tried using elseif and things similar but always either getting a error, tool breaks, or completely ignores the newly written code.

Here’s a modification of a melee script which I fixed up because currently I want to add a missed sound effect to this.

local func= script.Parent.punched

func.OnServerInvoke = function(plr, hum, dmg, tor)
local sound=“Sound”) --Takes Damage Here and Plays Audio
sound.SoundId= “rbxassetid://137579113”
–Add missed shot Audio queue here

An explanation to this would be appreciated.

Thank you for your time.

1 Like