Hi, I have an object that is meant to break when a specific team swings at it, however it takes damage just by coming into contact with a weapon, how can i refine this to only take damage when a weapon swing is taking place? I tried this line but knew it probably wouldnt work:
if hit.Parent:IsA("Tool") and hit.Parent.Activated then
I could do that, however the weapon script I use is a ServerScript, so bindable events would have to be used (if im not mistaken for Server-Server communication). Would you still say its a viable method (I haven’t used BindableEvents at all so not sure of their performance usage)
My way of understanding it was to do a check the name of the object the knife hits when it connects the Touched event, and if its the barricade name fire a bindable event, is that what you were more or less thinking?
Edit: Im already seeming to have a few issues with this method, could it not be done by checking the velocity of the tool hitting it? (As id imagine the velocity of the weapon would be 0 if you are just statically running around with it, but wouldn’t be the case if a weapon animation is playing?)
Well this is a tricky question. you could use a local variable that only activates once the sword gets activated and if it hits the part then it would destroy. but it’s not really the best. I don’t think there’s really any feature of doing this else way or at least I’m not aware of one.