I made a Volcano with a damagearea but im only getting damged once (when i enter the area)
Script inside the damagearea:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not hit.Parent:FindFirstChild("LavaHit") then local I = Instance.new("IntValue",hit.Parent) I.Name = "LavaHit" game.Debris:AddItem(I,5) hit.Parent.Humanoid:TakeDamage(10) end end)
Touched events only fire once, and that's when the object is on the edge of the collision area. Use Region3s.
I`m to lazy to rewrite the script, so I got one from the Dev Forum
local dmg = script.Parent.DamageValue.Value script.Parent.Touched:Connect(function(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if humanoid then humanoid:TakeDamage(dmg) end end)
It is a pretty simple script, you just add an IntValue named DamageValue and assign the damage you want to be dealt when it is touched. If you want to make it damage you multiple times I have a model of an effective damage brick which takes a customizable amount of damage and after a customizable interval of time it will take the same amount of damage. Here https://web.roblox.com/catalog/5618332380/Damage-Brick