Hey, i'm a beginner scripter trying to make a damaging script whenever you're touching a player and click. But for whatever reason the damage only shows on the client damaging the player. But it does not actually shows on the player being damaged (I hope you understand what I mean.) Code snippet below:
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local touchedConnection = humanoid.Touched:Connect(function(hit, limb)
if (hit.Name == "LeftArm" or hit.Name == "RightArm" or hit.Name == "Torso" or hit.Name == "Head") then
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
wait(0.3)
hit.Parent.Humanoid:TakeDamage(5)
end)
end
end)

1 comment
Oh, and this is a local script inside of startercharacterscripts.