Particle should emit after MaxFall Height is reached

so yeah as you can see i want a Blood Cloud to emit after the player falls from a really high point
(dont worry, wont include gore, i dont want to see any comments about “roblox is a game for kids, why do you need blood in it” etc, the game will never include gore, just ragdolls and Blood Particles (and few splatters)

anyway here is the script part of the Fall Damage (parent of “impact”)

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		local fallImpactScript = script.Impact:clone()
		fallImpactScript.Parent = character.Humanoid
		fallImpactScript.Disabled = false
	end)
end)

and here is the “Impact” script

local lowestFallHeight = 20 --how many studs you must fall before damage is inflicted
local maxFallHeight = 40 --if fallen from this many studs, 100% of health will be inflicted

local humanoid = script.Parent
local UpperTorso = humanoid.Parent.UpperTorso

local isFalling = false
local deb = false

humanoid.FreeFalling:connect(function(falling)
	isFalling = falling
	if isFalling and not deb then
		deb = true
		local maxHeight, lowHeight = 0, math.huge
		while isFalling do
			local height = UpperTorso.Position.y
			if height > maxHeight then
				maxHeight = height
			end
			if height < lowHeight then
				lowHeight = height
			end
			wait()
		end
		local fallHeight = maxHeight - lowHeight
		local impactHeight = fallHeight - lowestFallHeight
		if impactHeight > 0 then
			local damage = impactHeight * (humanoid.MaxHealth / maxFallHeight)
			humanoid:TakeDamage(damage)
			script.BloodCloud:clone().Parent = game.Workspace -- this is where my script starts (and doesnt work xD), Command Output says "Workspace.CarlosmaniaLAPTOP.Humanoid.Impact:35: Unexpected Unicode character: U+2028. Did you mean ' '?" at line 35 
			game.Workspace.BloodCloud.Enabled = true
			game.Workspace.BloodCloud:MoveTo(Vector3.new(0,0,0))
			wait(2.4)
				repeat
					wait(0.1)  	
						game.Workspace.BloodCloud.Transparency = +0.1
				until game.Workspace.BloodCloud.Transparency = 1
					if game.Workspace.BloodCloud.Transparency = 1 then Blood.Cloud:Destroy()
				end
			end
		end
		deb = false
	end
end)
end)
end)
end)

Help is apreciated.
as you can see i did not make the entire scripts myself, only added abit of script in it. (which obviously failed)

Here is an image of the Script Hierarchyoncegagainaskingforhelp

Can anyone answer plz with 30 characters +

Hey! The error “Unexpected Unicode character: U+2028” is a very common error, and you’re going to experience it lots (trust me), fortunately, the fix it very easy.

All you have to do is ctrl x your script (which cuts the script, and puts it in your clipboard which let’s you post it back), and then ctrl v it back into the script!

Boom, the script is fixed! Hope I helped!

1 Like

bro thx it helped, next error:

local lowestFallHeight = 20 --how many studs you must fall before damage is inflicted
local maxFallHeight = 40 --if fallen from this many studs, 100% of health will be inflicted

local humanoid = script.Parent
local UpperTorso = humanoid.Parent.UpperTorso

local isFalling = false
local deb = false

humanoid.FreeFalling:connect(function(falling)
    isFalling = falling
    if isFalling and not deb then
        deb = true
        local maxHeight, lowHeight = 0, math.huge
        while isFalling do
            local height = UpperTorso.Position.y
            if height > maxHeight then
                maxHeight = height
            end
            if height < lowHeight then
                lowHeight = height
            end
            wait()
        end
        local fallHeight = maxHeight - lowHeight
        local impactHeight = fallHeight - lowestFallHeight
        if impactHeight > 0 then
            local damage = impactHeight * (humanoid.MaxHealth / maxFallHeight)
            humanoid:TakeDamage(damage)
            script.BloodCloud:clone().Parent = game.Workspace -- this is where my script starts (and doesnt work xD), Command Output says "Workspace.CarlosmaniaLAPTOP.Humanoid.Impact:35: Unexpected Unicode character: U+2028. Did you mean ' '?" at line 35 
            game.Workspace.BloodCloud.Enabled = true
            game.Workspace.BloodCloud:MoveTo(Vector3.new(0,0,0))
            wait(2.4)
                repeat
                    wait(0.1)      
                        game.Workspace.BloodCloud.Transparency += 0.1
                until game.Workspace.BloodCloud.Transparency == 1
                    if game.Workspace.BloodCloud.Transparency == 1 then Blood.Cloud:Destroy()
                end
            end
        end
        deb = false
    end
end)

firstly the end) is missing and now it says this: Workspace.CarlosmaniaLAPTOP.Humanoid.Impact:44: Expected ‘)’ (to close ‘(’ at line 10), got ‘end’

whoa, i fixed it, it was the “end” missing an “)”, so basically the lowerest “end)” should replace the “end” over it and under it should be empty

local lowestFallHeight = 20 --how many studs you must fall before damage is inflicted
local maxFallHeight = 40 --if fallen from this many studs, 100% of health will be inflicted

local humanoid = script.Parent
local UpperTorso = humanoid.Parent.UpperTorso

local isFalling = false
local deb = false

humanoid.FreeFalling:connect(function(falling)
    isFalling = falling
    if isFalling and not deb then
        deb = true
        local maxHeight, lowHeight = 0, math.huge
        while isFalling do
            local height = UpperTorso.Position.y
            if height > maxHeight then
                maxHeight = height
            end
            if height < lowHeight then
                lowHeight = height
            end
            wait()
        end
        local fallHeight = maxHeight - lowHeight
        local impactHeight = fallHeight - lowestFallHeight
        if impactHeight > 0 then
            local damage = impactHeight * (humanoid.MaxHealth / maxFallHeight)
            humanoid:TakeDamage(damage)
            script.BloodCloud:clone().Parent = game.Workspace -- this is where my script starts (and doesnt work xD) 
            game.Workspace.BloodCloud.BloodCloud.Enabled = true
            game.Workspace.BloodCloud:MoveTo(Vector3.new(0,0,0))
            wait(2.4)
                repeat
                    wait(0.3)      
                        game.Workspace.BloodCloud.BloodCloud.Transparency += 0.1
                until game.Workspace.BloodCloud.BloodCloud.Transparency == 1
                    if game.Workspace.BloodCloud.BloodCloud.Transparency == 1 then game.workspace.BloodCloud:Destroy()
                end
            end
        end
        deb = false
    end)
--- for some reason the Output now is "- BloodCloud is not a valid member of Script", which is true, instead of it cloning it into workspace, it just disappears out of the entire game D:

what i want it to do: place a Blood Emitter at the position where the Player died, here is an image of the Hierarchy, btw just realized, as soon as running the game it disappears D:
dadadadaefs