Every time my script activates I am given error code -21 in console. The script does not subtract anything.
the code:
game.ReplicatedStorage.punchg.OnServerEvent:Connect(function(player, rayc, hp)
local part = rayc
local final = rayc:SubtractAsync({hp})
final.Parent = game.Workspace
end)
rayc is the wall, and hp is the part being subtracted from the wall

4 comments
your error code surely can not only be -21. We need the whole red text as this code seems fine. Are you sure your variables (parts) are given correct? Also what are you definging part for? you are not using it.
Oh and you should definitely put everything async into a pcall!!!
the line for defining part is useless now. i was using it in an earlier version of the script. also here is everything in developer console (https://ibb.co/0ZyRz0H)
Are you sure the wall is a BasePart? If yes, try restarting your studio and make sure you’re up-to-date.