i wrote a script like this i saw it in youtube but it's not working
script.parent.Touched:connect(Function(hit)
hum = hit.Character:FindFirstChild("Humanoid")
hum:TakeDamage(10)
end)
can any body tell me what's wrong with this?
i wrote a script like this i saw it in youtube but it's not working
script.parent.Touched:connect(Function(hit)
hum = hit.Character:FindFirstChild("Humanoid")
hum:TakeDamage(10)
end)
can any body tell me what's wrong with this?
Parent should have a big P. Why are you using Character? The object is already in workspace. Use Hit.Parent:FindFirstChild("Humanoid")
Character gets the character if the object is inside the player folder. Anything inside the player folder is not an object that can register a touched event.
can you tell me an anwser?
i mean an example
All you have to do is change line 1 and 3. Line 3 should be Use Hit.Parent:FindFirstChild("Humanoid") and line 1 scirpt.Parent.Touched:Connect(function(Hit)
i have another question why we do have to write hit.parent? why we are not using hit just alone
Because your arm is not the humanoid.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
thanks it worked