Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why does my script no longer work if its cloned?

Asked by 5 years ago

i was trying to make an attack by spawning a part with a script in front of a player and it worked if i just put the part in workspace, but if i clone the script into a part, it doesnt work anymore for some reason.

script.Parent.Touched:connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid")~= nil then

hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 25

script.Parent:remove()

end

end)

this is the script I used. I checked, and the script was cloned into the part, it had the right text in it and it wasnt disabled. does anyone know why this happens?

Answer this question