I know how to do an onTouched function:
function onTouched(part)
end
script.Parent.Touched:connect(onTouched)
But I'd like to know how to put the user who touched it on fire. I have a damage brick but I'd like a more realistic effect.
Damage = script.Parent.Damage.Value
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = h.Health - Damage
end
end
script.Parent.Touched:connect(onTouched)
^ That is my script so far! I've tried many things like:
Damage = script.Parent.Damage.Value
function onTouched(part)
local fire = Instance.new("Fire")
fire.Parent = game.Players.LocalPlayer.Torso
fire.heat = 5
fire.size = 30
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
h.Health = h.Health - Damage
end
end
script.Parent.Touched:connect(onTouched)
^ This script just breaks the entire brick! Thank you to everyone one who - tries to - help me!

3 comments
Thank you so much! I will try this right away. :)
It worked! Thank you, now I can make a realistic lava brick.
glad to help