I am a very new Roblox scripter and have absolutely no idea what I am doing. I am trying to create a punch script. I have a local script inside of StarterCharacterScripts that plays the punch animation and fires a remote event to do the damage, but i have no idea how to actually deal the damage. I have looked at the Roblox wiki, this website, and YouTube tutorials, but nothing has helped. I have tried to modify other's scripts, but to no avail. I would prefer if someone would explain what I need to do, rather than giving me a script to copy and paste, as I actually want to learn how to script, rather than copy scripts.
Here is the LocalScript:
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local playerboy = player.Character.Humanoid
local mouse = player:GetMouse()
local Humanoid = player.Character.Humanoid
local damage = 200
local hit = true
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=4800165198"
local playAnim = playerboy:LoadAnimation(anim)
playAnim:Play()
game.ReplicatedStorage.PunchEvent:FireServer()
end
end)
and here is the script in ServerScriptStorage:
game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect(function(player) -- the first argument is always the player who fired the remote
print("yes")
local LeftHand = player.Character.Humanoid
script.Parent.LeftHand.Touched:connect(function(hit, dmg)
if hit.Parent.Humanoid and dmg == true then
hit.Parent.Humanoid:TakeDamage(200) -- change 20 to amount of damage
dmg = false
wait(1)
dmg = true
end
end)
end)
Thanks in advance for helping a noob out :).

4 comments
The problem I think is your variable for LeftHand, Instead of "player.Character.Humanoid" why not "player.Character.HumanoidRootPart" or the lefthand itself.
I'm not sure but the humanoid I think doesn't have an hitbox making it imposibble to touch
How would I make a hitbox? I am getting the error "LeftHand is not a valid member of ServerScriptService"
script.Parent.LeftHand -- you were calling the Parent of the script, which is ServerScriptStorage, and then asking it for an instance named "LeftHand", which does not make any sense.