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

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

Asked by 10 years ago
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)
0
nvm User#600 0 — 10y
0
it keeps saying hit is nil? User#600 0 — 10y
0
it should work right? hit should be there if the torso touches another player User#600 0 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

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)

Ad

Answer this question