Hello, i am trying to make a Advanced Sword System, i made the animations, but i dont know how can i make the walking animation and the idle animation when the Sword is equipped.
I already search in the internet for result but none of them helped.
You would have to make a script that does something along these lines:
-- author - @DevKeia @8/31/22
-- for devfourm (made for TheFurukanDev) --
-- The Default Animations, just got them from the character. --
local DefaultAnimationIdle1 = "http://www.roblox.com/asset/?id=2510196951"
local DefaultAnimationIdle2 = "http://www.roblox.com/asset/?id=2510197257"
local DefaultAnimationRun = "http://www.roblox.com/asset/?id=2510198475"
script.Parent.Equipped:Connect(function()
--// Varibles
-- We are just getting the player --
local plr = game.Players.LocalPlayer
local Character = plr.Character
-- Here, we are defining the players animations! --
local IdleAnim = Character.Animate.idle.Animation1.AnimationId
local IdleAnim2 = Character.Animate.idle.Animation2.AnimationId
local RunAnimation = Character.Animate.run.RunAnim.AnimationId
-- NOTE: You really don't need to change
-- The walk animation, no point, your run anim is your walk.
-- Change "Your Animation Id" to the animation ids
-- Make sure you put an animation into workspace and
-- Let that define it as an asset, because roblox
-- Does not know if it is an asset or not.
IdleAnim = "Your Animation Id"
IdleAnim2 = "Your Animation Id"
RunAnimation = "Your Animation Id"
end)
script.Parent.Unequipped:Connect(function()
--// Varibles
-- Here we are just setting it back --
local plr = game.Players.LocalPlayer
local Character = plr.Character
local IdleAnim = Character.Animate.idle.Animation1.AnimationId
local IdleAnim2 = Character.Animate.idle.Animation2.AnimationId
local RunAnimation = Character.Animate.run.RunAnim.AnimationId
-- Change the varibles at the top if you have custom --
-- Animations for the idle & the run --
RunAnimation = DefaultAnimationRun
IdleAnim = DefaultAnimationIdle1
IdleAnim2 = DefaultAnimationIdle2
end)