Puddle Widening on new position of NPCs Body after death, can anyone help?
Asked by
5 years ago Edited 5 years ago
I want to have this "puddle" spread outward and i have made it work when the NPC it is in dies, it spreads randomly outward in seperate places, but once the npc has flown away or slid from the attack, the puddle is at least 10 studs away from the body. I have tried to make it spawn on the general position of the Humanoid root part on the NPC, but it wont do it. Maybe one of you smarter people could help out. All help appreciated! EDIT: I need for this code to work still, but execute at the position of the dead NPCs body. Code:
01 | local Char = script.Parent |
02 | local Hum = Char:WaitForChild( "Humanoid" ) |
03 | local Tor = Char:WaitForChild( "Torso" ) |
06 | local rates = { 0.05 , 0.075 , 0.1 , 0.15 } |
08 | local smooth = function (P) |
09 | local SM = Enum.SurfaceType.SmoothNoOutlines |
18 | local function BloodPool(Part,Size) |
19 | local Pool = Instance.new( "Part" ,game.Workspace) |
22 | Pool.BrickColor = BrickColor.new( "Dusty Rose" ) |
23 | Pool.Material = "Glass" |
24 | Pool.Transparency = 0.5 |
25 | Pool.CanCollide = false |
26 | Instance.new( "CylinderMesh" ,Pool) |
28 | Pool.Name = "BloodPoolPart" |
30 | Pool.FormFactor = Enum.FormFactor.Custom |
34 | local c = Part.CFrame*CFrame.new(M(- 3.01 , 3.01 ),- 2.9 ,M(- 3.01 , 3.01 )) |
35 | coroutine.resume(coroutine.create( function () |
36 | local rate = rates [ M( 1 ,#rates) ] |
38 | game.Debris:AddItem(Pool, 15 ) |
42 | Pool.Size = Pool.Size+Vector 3. new(rate, 0 ,rate) |
49 | local function BloodDrops(Size,Area) |
50 | local Blood = Instance.new( "Part" ,game.Workspace) |
51 | Blood.BrickColor = BrickColor.new( "Crimson" ) |
55 | Blood.FormFactor = Enum.FormFactor.Custom |
57 | Blood.CFrame = Area*CFrame.new(M(- 1.00 , 1.00 ),M(- 1.00 , 1.00 ),M(- 1.00 , 1.00 )) |
64 | Hum.Changed:connect( function () |
65 | if Hum.Health<Heath then |
67 | for i = 1 , math.random( 4 , 10 ) do |
68 | local Size = Vector 3. new(M(- 0.25 , 0.25 ),. 05 ,M(-. 25 ,. 25 )) |
69 | local Blood = BloodDrops(Size,Tor.CFrame) |
71 | local Size 2 = Vector 3. new(M(- 0.25 , 0.25 ),. 05 ,M(-. 25 ,. 25 )) |