i tried
1 | if char:findFirstChild( "Tool" ) then |
I didnt know what to do next make the health infinite? that wouldnt work its a fighting game. I dont know if this is possible but yeah. I know the handle doesnt damage the player, but im not using a handle
You will need to add another check. Example
01 | remote.OnServerEvent:Connect( function (plr) |
02 | local character = plr.Character |
03 | local newPart = Instance.new( "Part" ) |
04 | newPart.Anchored = true |
05 | newPart.Position = Vector 3. new( 0 , 0 , 0 ) |
06 |
07 | newPart.Touched:Connect( function (hit) |
08 | if hit:IsDescendantOf(character) then return end --the check |
09 | print ( "KONO DIO DA" ) |
10 | end ) |
11 |
12 | end ) |
The touched event sends the part that was touched as a parameter. Using :IsDescendantOf() is a check to see if the part that was touched is a part of the players character
01 | local Debounce = false |
02 |
03 | script.Parent.Touched:connect( function (hit) |
04 | if hit.Parent:FindFirstChild( "Humanoid" ) and Debounce = = false then |
05 | Debounce = true |
06 | hit.Parent.Humanoid:TakeDamage( 100 ) |
07 | wait( 1 ) |
08 | Debounce = false |
09 | end |
10 | end ) |
This script will make damage to a player.