this is my script: script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 20 script.Parent:Destroy() end end)
COMMUNITY QUESTION
why when i clone the script, the script isnt working?
1 answer
You are not cloning the script? You are destroying it, I'm assuming that you want to clone the script, if so use this
script.Parent.Touched:connect(function(hit)
If hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 20
script.Parent:Clone()
end end)
2 comments
0
Also, why would you want to clone a script?
0
This should work, you just used destroy instead of clone jona.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Code block
If you need to clone a script you are doing something wrong and there is likely a better way