I'm getting the error RightHand is not a valid member of Model "Workspace.ItzSulfonic - line 4 R6
01 | local DB = false |
02 |
03 | game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect( function (plr,Touch) |
04 | plr.Character.RightHand.Touched:connect( function (hit) |
05 | if hit.Parent ~ = plr.Character then |
06 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
07 | if DB = = false then |
08 | DB = true |
09 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10 |
10 | wait(. 6 ) |
11 | DB = false |
12 | end |
13 | end |
14 | end |
15 | end ) |
16 | end ) |
The right hand has a space in it so if you wanted it as a right-hand use this code!
Sorry it didn't work for you so I fixed it
01 | local DB = false |
02 |
03 | game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect( function (plr,Touch) |
04 | plr.Character:WaitForChild( "Right Hand" ).Touched:connect( function (hit) |
05 | if hit.Parent ~ = plr.Character then |
06 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
07 | if DB = = false then |
08 | DB = true |
09 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10 |
10 | wait(. 6 ) |
11 | DB = false |
12 | end |
13 | end |
14 | end |
15 | end ) |
16 | end ) |
It's because the right hand is not a member of your character, it's the right arm.
01 | local DB = false |
02 |
03 | game.ReplicatedStorage.PunchEvent.OnServerEvent:Connect( function (plr,Touch) |
04 | plr.Character.Right Arm.Touched:Connect( function (hit) -- And yes it has a space for some reason, that's Roblox's fault |
05 | if hit.Parent ~ = plr.Character then |
06 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
07 | if DB = = false then |
08 | DB = true |
09 | hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10 |
10 | wait(. 6 ) |
11 | DB = false |
12 | end |
13 | end |
14 | end |
15 | end ) |
16 | end ) |