My current script DOES work, just has a setback, it lags the server pretty hard. any suggestions on optimizing it, so it doesn't lag the server?
local char = script.Parent
local humanoid = char.Humanoid
local head = char.Head
wait(1)
script.Parent.laser.Transparency = 0.5
script.Parent.laser2.Transparency = 0.5
script.Parent.laser3.Transparency = 0.5
script.Parent.laser4.Transparency = 0.5
script.Parent.laser5.Transparency = 0.5
script.Parent.laser6.Transparency = 0.5
script.Parent.Humanoid.WalkSpeed = 0
wait(2)
script.Parent.laser.Transparency = 0
script.Parent.laser2.Transparency = 0
script.Parent.laser3.Transparency = 0
script.Parent.laser4.Transparency = 0
script.Parent.laser5.Transparency = 0
script.Parent.laser6.Transparency = 0
local db = false
script.Parent.laser.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser2.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser2.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser3.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser4.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser5.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
script.Parent.laser6.Touched:Connect(function(hit)
if db == false then
db = true
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -25
end
end)
end)
end)
end)
end)
end)
end)
wait(1)
script.Parent.laser.Transparency = 1
script.Parent.laser2.Transparency = 1
script.Parent.laser3.Transparency = 1
script.Parent.laser4.Transparency = 1
script.Parent.laser5.Transparency = 1
script.Parent.laser6.Transparency = 1
script.Parent.Humanoid.WalkSpeed = 7
end
end

3 comments
maybe close ur touched event functions before you start a new one
you should consider using more conventional scripting though
You provided very little information. I don't know what your hierarchy looks like. If you could provide me an image of your hierarchy, I can definitely help.