Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ply = game.Players.LocalPlayer
- local char = ply.Character
- Animations = {"LeftSlash", "LeftSwingFast", "Stab1", "Stab2"}
- AnimateModel = Instance.new("Model",char)
- AnimateModel.Name = "AnimationObjects"
- an = Instance.new("Animation", AnimateModel)
- an.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
- an.Name = "LeftSlash"
- an2 = Instance.new("Animation", AnimateModel)
- an2.AnimationId = "http://www.roblox.com/Asset?ID=86313418"
- an2.Name = "LeftSwingFast"
- an3 = Instance.new("Animation", AnimateModel)
- an3.AnimationId = "http://www.roblox.com/Asset?ID=96559159"
- an3.Name = "Stab1"
- an4 = Instance.new("Animation", AnimateModel)
- an4.AnimationId = "http://www.roblox.com/Asset?ID=96559161"
- an4.Name = "Stab2"
- an5 = Instance.new("Animation", AnimateModel)
- an5.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
- an5.Name = "Equip"
- local Damage = 8.5
- local SwingTime = 0.5
- local LastSwing = tick()
- local IsEquipped = false
- function GetRandomAnimation()
- local r = math.random(1,#Animations)
- local rng = Animations[r]
- return rng
- end
- function MouseEvent()
- if (tick() - LastSwing) >= SwingTime then
- LastSwing = tick()
- if IsEquipped == true then
- local CurlAnim = GetRandomAnimation()
- if CurlAnim ~= nil then
- local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects[CurlAnim])
- RunningAnim = Anim
- Anim:Play(nil,nil,1.2)
- coroutine.resume(coroutine.create(function()
- wait(0.5)
- if RunningAnim == Anim then
- Anim = nil
- end
- end))
- end
- end
- end
- end
- function Equip(mouse)
- IsEquipped = true
- LastSwing = tick()
- mouse.Button1Down:connect(MouseEvent)
- wait(0.02)
- local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects.Equip)
- RunningAnim = Anim
- Anim:Play(nil,nil,1.5)
- wait(1.3)
- end
- function UnEquip()
- IsEquipped = false
- end
- script.Parent.Equipped:connect(Equip)
- script.Parent.Unequipped:connect(UnEquip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement