Guys, I have tried creating sword using EppoBot script. It succeed, but the only thing I have unfinished is other attacks. In other words, in his video his sword has only ONE attack animation, while official ROBLOX sword has lunge, attack_1, attack_2, etc. If anybody can help, PLEASE help me adding second animation because I've searched likely every page of internet, but not even close to thing I've wanted. There is also another thing I would like to do. It's adding idle animation to this script (You can help as you wish). It would be best if you would give me answer. Thank you!
Here is 1st script:
local CanAttack = true
script.Parent.Activated:connect(function()
local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then attack:Play() CanAttack = false wait(1) attack:Stop() CanAttack = true script.Parent.CanDamage.Value = true end
end)
Here is 2nd script (incase you need it):
script.Parent.blade.Touched:connect(function(p)
if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = true p.Parent.Humanoid:TakeDamage(5) end
end)
local animations = {"1","2"} -- put ur animation ids here local CanAttack = true script.Parent.Activated:connect(function() if CanAttack == true then script.Parent.CanDamage.Value = true local animation = Instance.new("Animation", script.Parent.Parent) animation.AnimationId = "http://www.roblox.com/asset?id="..animations[math.random(1, #animations)] local chosenanim = script.Parent.Parent.Humanoid:LoadAnimation(animation) chosenanim:Play() CanAttack = false wait(1) CanAttack = true script.Parent.CanDamage.Value = false end end)
Make sure to change 1 and 2 with ur own animation id's. This script takes a random animation from ur animations list and plays it if the sword is used. Also I changed the can damage thingy because now if you swing u can damage if your sword is idle (not attacking) it doesn't do damage
EDIT: I have made it into a tool. did not add the damage script though. take it here: https://www.roblox.com/catalog/01463426021/redirect