I have tried making something but it doesn't seem to be working, here is my script in the lazer:
function onTouch(part) if script.Parent.Transparency == 0 then local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then humanoid.Health = 0 end end end while true do script.Parent.Transparency = script.Parent.Transparency + 0.5 wait(0.5) script.Parent.Transparency = script.Parent.Transparency + 0.5 wait(1) script.Parent.Transparency = 0 wait(1.5) end script.Parent.Touched:Connect(onTouch)
sorry this is a late reply but
function onTouch(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h ~= nil then h.Health = 0 end end script.Parent.Touched:Connect(onTouch)
not sure how to do the when its invisible not kill but i would suggest to add and if then elseif to your script saying if its transparency == 0 then h.Health = 0 else if transparency == 1 then h.Health = 10 or something along those lines have a look at dev forum, google ect to find out how
would this work? function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then -- if a humanoid exists, then humanoid.Health = 0 -- damage the humanoid end end function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") script.Parent.Touched:connect(onTouch) if script.Parent.Transparency == 1 then if (humanoid ~= nil) then humanoid.Health = 0 end end end