If you're really persistent on using pcall, you should know that you're using it incorrectly.
You cannot use : when trying to index a function, as this implies you are calling the function. object:Fn(...) is the same as object.Fn(object, ...) so in order to do the pcall correctly, youll need .
The way to achieve this is like this:
pcall(attacked.Parent.Humanoid.TakeDamage,attacked.Parent.Humanoid,1)
Lets break this down.
First, we index the function TakeDamage by using . which is the correct way, as mentioned above. Then, like i explained, since object:Fn(...) is the same as object.Fn(object, ...), we have to pass the object to the pcall. (anything separated by commas after the 1st function will be passed to the function) Then we can pass the amount of damage to take, which in your case is 1.
4 comments
Could you please include the whole script or most of it as this is hard to understand
done
I don't really understand what the problem is. Do you mean that sometimes, it isn't a character that touches Range, but another part?
exactly, sorry for no clarification before xd