My bleeding script does not work correctly, the damage part does work but well yeah...
The blood portion does not work however, so can anyone help me figure out how to fix this?
Any and all help is appreciated.
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Parent then |
03 | local hum = hit.Parent:findFirstChild( "Humanoid" ) |
04 | if hum then |
05 | local character = hit.Parent |
06 |
07 | local blood = Instance.new( "Part" ) |
08 | blood = Instance.new( "Part" ) |
09 | blood.Material = Enum.Material.Granite |
10 | blood.BrickColor = BrickColor.new( "Really red" ) |
11 | blood.Anchored = false |
12 | blood.Locked = true |
13 | blood.Size = Vector 3. new( 1 , 1 , 1 ) |
14 |
15 | local BloodClone = blood:Clone() |
There were a couple of things that caused it not to work. If you are using the Position of a Brick, you have to use Vector3.new(). Not CFrame. You also put the script in a loop so that it would always lose health and never continue. I tried to clean up your code a bit. Hope this helps! Thumbs up if it did!
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Parent then |
03 | local hum = hit.Parent:findFirstChild( "Humanoid" ) |
04 | if hum then |
05 | local character = hit.Parent |
06 | blood = Instance.new( "Part" ) |
07 | blood.Material = Enum.Material.Granite |
08 | blood.BrickColor = BrickColor.new( "Really red" ) |
09 | blood.Anchored = false |
10 | blood.Locked = true |
11 | blood.Size = Vector 3. new( 1 , 1 , 1 ) |
12 | local BloodClone = blood:Clone() |
13 | local torso = character:findFirstChild( "Torso" ) |
14 |
15 | function bloodspawn() |