I'm made a part so that whenever you touch it, you get set on fire and take damage. But it's not working and there's an error in the output saying Humanoid is not a valid member of Accessory. Here's my script.
local value = script.Value.Value
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent.Humanoid
if humanoid then
if value == false then
value = true
local fire = Instance.new("Fire")
fire.Enabled = true
fire.Position = hit.Position
fire.Heat = 5
fire.Size = 10
local function dmg()
if value == true then
humanoid.Health = humanoid.Health - 12.5
wait(2)
end
end
end
end
end)

1 comment
Nvm I solved the problem. Turns out, the error in the output literally didn't affect anything. I came to find out that the real error was that fire doesn't have a property called "Position" so instead, I parented the fire to the "hit."