I am trying to create a laser gun which damages a zombie. For some reason, the code I used didn't work. Please help.
local zombie = workspace.Zombie script.Parent.Activated:Connect(function() script.Parent.Handle.Beam.Enabled = true script.Parent.Handle.Fire:Play() while script.Parent.Activated == true do zombie.Humanoid.Health = zombie.Humanoid.Health - 150 wait(.1625) end end) script.Parent.Deactivated:Connect(function() script.Parent.Handle.Beam.Enabled = false script.Parent.Handle.Fire:Stop() end)
script.Parent.Activated:Connect(function() script.Parent.Handle.Beam.Enabled = true script.Parent.Handle.Fire:Play() zombie.Humanoid.Health = zombie.Humanoid.Health - 150 wait(.1625) end)
Closed as Non-Descriptive by hiimgoodpack and maumaumaumaumaumua
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?