(Roblox Lua newbie here)
So I've been making these two bricks. One of them would light up the player with fire(and smoke) and the other one would remove the effects. (I still have yet to add damage)
The thing is, those two functions only work once. In other words, when the player touches the lava brick(effects appear) then the water brick(effects disappear) and then when the player touches the lava brick once again effect doesn't reappear.
Error: The parent property of fire is locked, current parent: NULL, new parent Torso.
Here's what I currently have:
local lava = game.Workspace.Lava
local water = game.Workspace.Water
aflame = Instance.new("Fire")
local newSmoke = game.Workspace.Prefabs.Part.Smoke:clone()
function onFire(bpart)
aflame.Parent = bpart.Parent.Torso
newSmoke.Parent = bpart.Parent.Torso
end
end
lava.Touched:Connect(onFire)
function fireGone(bpart)
local fireRemove = bpart.Parent.Torso:FindFirstChild("Fire")
local smokeRemove = bpart.Parent.Torso:FindFirstChild("Smoke")
if fireRemove then
fireRemove:Destroy()
smokeRemove:Destroy()
end
end
water.Touched:Connect(fireGone)
Any help is greatly appreciated.

1 comment
Thanks! I'll try it out as soon as I can...