Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why is my bleeding script not working?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

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.

01script.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 
07local blood = Instance.new("Part")
08blood = Instance.new("Part")
09blood.Material = Enum.Material.Granite
10blood.BrickColor = BrickColor.new("Really red")
11blood.Anchored = false
12blood.Locked = true
13blood.Size = Vector3.new(1,1,1)
14 
15local BloodClone = blood:Clone()
View all 36 lines...
0
You need to be more specific in "not working", is there no effect at all, is there an error in your code or what? PreciseLogic 271 — 9y
0
The damage portion of the script works however the actual blood drop portion does not. IcyEvil 260 — 9y
0
Why do you repeat "blood = Instance.new("Part")" twice? thehybrid576 294 — 9y
0
@EmperorVolvax is not moving the blood to the character and is not placing the blood in the workspace. the blood is spawning in nil and getting auto deleted. LostPast 253 — 9y

1 answer

Log in to vote
1
Answered by
TrollD3 105
9 years ago

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!

01script.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 = Vector3.new(1,1,1)
12          local BloodClone = blood:Clone()
13          local torso = character:findFirstChild("Torso")
14 
15        function bloodspawn()
View all 33 lines...
0
Works Thank You! IcyEvil 260 — 9y
Ad

Answer this question