I am just working on something for fun, I have an animation and I know how to make a press key plays animation on a player. But I can’t figure out how to do when it plays it that it damages the other player/enemy. If you know what script I can use and where the script goes and what to add because I have very small scripting knowledge. I have my scripts ready and all I just need it when the player hits other player or rig with the foot or leg it damages the other player/rig.
How about you just make a combat system and have the animations also play
Use UserInputService to detect the key pressed event, and use
local anim = humanoid:LoadAnimation(script.Animation ) --<Just an example to get the animation. Then use anim:Play()
Okay, I have that but what about the damage script. I don’t really know where to put these scripts cause I have bad knowledge of scripting/
I don’t know where to put anything either. Just an example that I don’t know :::
depending on how you handle the animation (i’d assume you’re loading it on the client), you’d want to handle the damage on the server so it replicates accurately to another enemy/player, because of FilteringEnabled.
what i do for my attacks when i’m coding them is have the userinputs send a remote to a server script that makes a small Region3 around the player who sent the remote, and check if any enemies are inside it, and if so, attack them.
let me know if you’d like any clarification.