Advertisement
Guest User

no

a guest
Jun 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. ocal plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:wait() local tool = script.Parent local swing = tool:WaitForChild("Swing") local canattack = tool:WaitForChild("CanAttack") tool.Equipped:connect(function() local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) idle:Play() end) tool.Activated:connect(function() local choose = math.random(1,2) if choose == 1 then canattack.Value = false local s1animation = script.Parent.Parent.Humanoid:LoadAnimation(script.Punch1) swing:Play() s1animation:Play() elseif choose == 2 then canattack.Value = false local s2animation = script.Parent.Parent.Humanoid:LoadAnimation(script.Punch2) swing:Play() s2animation:Play() end end) tool.Deactivated:connect(function() canattack.Value = true end) tool.Unequipped:connect(function() local hum = char:WaitForChild("Humanoid") for _,anim in pairs(hum:GetPlayingAnimationTracks()) do anim:Stop() end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement