When I was testing my gun, it damaged me than the person that I was shooting, Why? Any way to fix it?
Gun script:
local debounce = false
script.Parent.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function(idk)
if debounce then else
******************:FireServer(mouse.Target.Parent)
debounce = true
wait(1)
debounce = false
end
end)
end)
RemoteEvent script:
script.Parent.OnServerEvent:Connect(function(key)
if workspace[key.Name]:FindFirstChild("Humanoid") then
workspace[key.Name].Humanoid:TakeDamage(10)
end
end)
Thank you in advance!

6 comments
So, now it has 2 arguments. Which one is passed off as the one who got shot? I used "plr" and it didn't fix it.
Key is still the one that got shot. When you go from client to server your first parameter for OnServerEvent is always the player who fired the script, so your key that you passed from the local script is in the second slot where Key is now. The way you had it before with Key in the first slot, it was reading Key as the player that called the script, rather than the passed parameter.
"attempt to index local 'key' (a nil value)"
I saw my error: I didn't tell Lua the mouse's target.
With my error being fixed, thank you!
Np