So as you see this is a function
obj.Touched:Connect(function(hitObj) -- if obj is hit. light HitObj on fire
if effectThere then -- check if its the right material. Or a humanoid
if hitObj.Parent:FindFirstChild('Humanoid') then
flameObject(hitObj)
elseif materials:FindFirstChild(hitObj.Material.Name) then
flameObject(hitObj)
end
else
print('STOP THE FUNCTION') -- I want to stop the function here
end
end)
Anyhow if a certain value is not met I want this function to stop running for this script. Cause then every time the obj touches something this will trigger.
Cool thanks