There are no errors, it also does not print "work" so I think its when you touch it
config = script.Parent.Configuration
damage = config.Damage
damageinterval = config.DamageInterval
imageparticle = config.ImageParticleAddress
dying = false
debounce = false
function onTouched(hit) --When Touched
print("work")
if debounce == false then
debounce = true
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
game.ReplicatedStorage.Damage:Clone().Parent = hit.Parent.Torso
hit.Parent.Torso.Damage.Texture = imageparticle.Value
dying = true
damagingfunc(human) --Launches function
end
end
end
function offTouched(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
if hit.Parent.Torso:FindFirstChild("Damage") then
hit.Parent.Torso.Damage:Destroy()
end
dying = false
debounce = false
end
end
function damagingfunc(human)
local health = game.Players:GetPlayerFromCharacter(human.Parent).stats.health
while dying == true do
health.Value = health.Value - damage.Value
wait(damageinterval.Value)
end
end
script.Parent.Touched:connect(onTouched)
script.Parent.TouchEnded:connect(offTouched)

3 comments
I am not sure how to make a local script of this, it works on a normal script, just not for multiple people
IS your local script in one of those 5 places? If so, are you referencing things correctly
Use a normal script. https://scriptinghelpers.org/questions/23644/local-script-not-working-and-no-errors-in-output