Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help, Script won't work? D:

As the title sais, the following script won't work:

local Log = script.Parent.Head
function onTouch (Brick)
	if Log.Parent.Humanoid.Health == 0 then
		local Fire = Instance.new("Fire", script.Parent.Head)
		Fire.Size = 10
		Fire.Color = Brick.color:Random()
		Fire.SecondaryColor = Brick.Color:Random()
        wait(2)
        Fire:Remove()
	end
end
Log.Touched:connect(onTouch)

ok so I want it so when the health is 0 it lights up fire. But the problem is I can't Damage the Model... Can you help me please?

7 comments

0

plz put the code in code block

0

done.

0

what do you expect with the code

0

Read the Desc.

0

so do you want to do it. When you're dead and you touch a brick, your head will be in fire?

0

I need it so, I can Damage the Model, Even though I've inserted a Humanoid I can't Damage it

0

or do you want to kill a guy and make his head to fire?

1 answer

Everything seems correct except your use of BrickColor's Random function. It should be used like so.. BrickColor.Random() instead of.. Brick.Color:Random()

local Log = script.Parent.Head

function onTouch (Brick)
	local humanoid = Log.Parent.Humanoid
	if Brick and humanoid.Health > 0 then
		humanoid:TakeDamage(10)

	else 
		local Fire = Instance.new("Fire", Log)
		Fire.Size = 10
		Fire.Color = BrickColor.Random()
		Fire.SecondaryColor = BrickColor.Random()
		wait(2)
		Fire:Remove()
	end
end

Log.Touched:connect(onTouch)

1 comment

0

Yeah, But I cant Damage the Model D:

This discussion is preserved as it was. New answers, comments, and votes are closed.