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

Why does this keep saying that findfirstchild cant be used with part?

script.Parent = Workspace.guig37
player = Workspace.guig37
t = player.Torso
la = player['Left Arm']
ra = player['Right Arm']
ll = player['Left Leg']
rl = player['Right Leg']
h = player.Head
player.Humanoid.MaxHealth = math.huge
ft = Instance.new("Fire", t)
ft.Size = 10
ft.Color = Color3.new(0,0,0)
ft.SecondaryColor = Color3.new(0,0,0)
fla = ft:clone()
fla.Parent = la
fra = ft:clone()
fra.Parent = ra
fll = ft:clone()
fll.Parent = ra
frl = ft:clone()
frl.Parent = rl
fh = ft:clone()
fh.Parent = h
t.Touched:connect(function()
	hit = t:FindFristChild('Humanoid')
    if hit.Name == t then
   	elseif
  	hit.Name == la then
    elseif
    hit.Name == ra then
    elseif
    hit.Name == ll then
    elseif
    hit.Name == la then
    elseif
    hit.Name == h then
    else
    hitchar = hit.Parent
    ht = hitchar.Torso
    hla = hitchar['Left Arm']
    hra = hitchar['Right Arm']
    hll = hitchar['Left Leg']
    hrl = hitchar['Right Leg']
    hh = hitchar.Head
    fht = ft:clone()
    fht.Parent = ht
    fhla = ft:clone()
    fhla.Parent = hla
    fhra = ft:clone()
    fhra.Parent = hra
    fhll = ft:clone()
    fhll.Parent = hra
    fhrl = ft:clone()
    fhrl.Parent = hrl
    fhh = ft:clone()
   	fhh.Parent = hh
    for burning = 1, 80 do
        wait(.1)
        hit.Health = hit.Health -1.25
	end
end
end)

3 comments

0

nvm

0

it keeps saying hit is nil?

0

it should work right? hit should be there if the torso touches another player

1 answer

From the looks of it, it looks like you're burning yourself?

t.Touched:connect(function(hit) print(hit) end -- should look like this
script.Parent = Workspace.guig37
player = Workspace.guig37
t = player.Torso
la = player['Left Arm']
ra = player['Right Arm']
ll = player['Left Leg']
rl = player['Right Leg']
h = player.Head
player.Humanoid.MaxHealth = math.huge
ft = Instance.new("Fire", t)
ft.Size = 10
ft.Color = Color3.new(0,0,0)
ft.SecondaryColor = Color3.new(0,0,0)
fla = ft:clone()
fla.Parent = la
fra = ft:clone()
fra.Parent = ra
fll = ft:clone()
fll.Parent = ra
frl = ft:clone()
frl.Parent = rl
fh = ft:clone()
fh.Parent = h
t.Touched:connect(function(hit)
	hitchar = hit.Parent
	ht = hitchar.Torso
	hla = hitchar['Left Arm']
	hra = hitchar['Right Arm']
	hll = hitchar['Left Leg']
	hrl = hitchar['Right Leg']
	hh = hitchar.Head
	fht = ft:clone()
	fht.Parent = ht
	fhla = ft:clone()
	fhla.Parent = hla
	fhra = ft:clone()
	fhra.Parent = hra
	fhll = ft:clone()
	fhll.Parent = hra
	fhrl = ft:clone()
	fhrl.Parent = hrl
	fhh = ft:clone()
	fhh.Parent = hh
	for burning = 1, 80 do
		wait(.1)
		hitchar.Humanoid.Health = hitchar.Humanoid.Health -1.25 -- you forgot to take health away from the humanoid, not the part that hit.
	end
end)

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