I made an animation than I tried to script it but I don't know what to type.
COMMUNITY QUESTION
How to i scrpt a weapon e.x. sword?
1 answer
Put This In A Local Script Inside The Tool:
local plr = game.Players.LocalPlayer--get the player
repeat wait()--repeat loop to wait until the player is fully loaded and the tool is equipped
plr = game.Players.LocalPlayer
until plr
local animationID = Put The ID For The Animation Here, I.E. rbxassetid://1432137785
local hum = script.Parent.Parent:WaitForChild("Humanoid")
local animation = Instance.new("Animation")--create an animation
animation.AnimationId = animationID--set the animation id
animation.Parent = script.Parent--parent it to the player
local a = LoadAnimation(animation)--load the animation into the player
script.Parent.Activated:Connect(function()--when someone clicks with the tool out
a:Play()--play the animation
end)
This will make the animation play whenever you click with the tool equipped.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
you CANNOT expect to be able to make a sword/weapon with animations, and dont come here asking for an entire script if that was your intention. obviusly you havent made much of an effort creating this post. If i were you i would try to mess around with animations and such before you try to make a sword.
^ That seems a bit harsh. o.o Please use the following sources please when creating and formating your question @OP:
https://scriptinghelpers.org/blog/posting-good-questions-and-answers-on-scripting-helpers
https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site