I’m trying to make something similar to this. Jotaro throws knife epicly - YouTube
but i don’t even know where I would get started. please send feedback on how i would do this / explaining thank you!
what is the difference between user input service and uis
i don’t want throwing knives to be a tool
I recommend reading this tutorial but not using a tool. You can use UserInputService or ContextActionService to play an animation which throws the knife. Then, you could duplicate the knife and insert a BodyVelocity to shoot it. Then, delete the duplicated knife after a while.
how would i make the body velocity the same to where they are looking i know with the cframe.lookvector but
Multiply the player’s lookVector with the distance you want the knife to go.
so heres what you could do:
make a local script and place in inside starterpack (unless you dont want the player to start with the move, which in that case you would parent the localscript to the player’s Backpack when you want them to have them move)
then in the local script use uis to detect inputs and if it is the knife throw key make it play the animation and fire a remote event to the server
for the remote event just make one and place it in replicated storage
then make a script in sss (serverscriptservice) and make that script clone a knife model in ss (serverstorage) or rp (replicatedstorage) and then parent it to workspace and set the cframe to the character’s humanoidrootpart’s cframe (also make sure the knife has cancollide off)
now you could use a bodyvelocity to move the knife forward (set its velocity to the humanoidrootpart’s lookvector * the range of the knife)
now use a Touched event to detect when the knife is touched and when it is check if the touched part 1: has a humanoid in its parent and 2: its parent is not the character who threw the knife then use humanoid:TakeDamage(and then put the damage amount here)
and that should be it. hope this helped!
ALSO: if you wanna make a mobile button just make a button and set it visible if the player is on mobile then fire the remote event and play the animation when the button is pressed
thanks will try out!!!
no problem, if you need anymore help ill be here