Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tool = script.Parent;
- local walking = 0
- local hold
- local walk
- local walk2
- local walk3
- local walk4
- local walk5
- odctrl = script.Parent.ODCTRL
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- --blade:FireServer()
- end
- function onKeyDown(key)
- local vCharacter = Tool.Parent
- local humanoid = vCharacter.Humanoid
- if walk and (key == "t") then
- if odctrl.Value == true then
- walk:Play()
- walking = walking + 1
- print 't'
- end
- end
- if walk2 and (key == "q") then
- if odctrl.Value == true then
- walk2:Play()
- walking = walking + 1
- print 'q'
- end
- end
- if walk3 and (key == "e") then
- if odctrl.Value == true then
- walk3:Play()
- walking = walking + 1
- print 'e'
- end
- end
- if walk4 and (key == "r") then
- if odctrl.Value == true then
- walk4:Play()
- walking = walking + 1
- print 'r'
- end
- end
- if walk5 and (key == "f") then
- if odctrl.Value == true then
- walk5:Play()
- walking = walking + 1
- print 'f'
- end
- end
- end
- function onKeyUp(key)
- if walk or walk2 or walk3 or walk4 or walk5 and (key == "q") or (key == "e") or (key == "r") or (key == "f") or (key == "t") then
- walking = walking - 1
- if walking == 0 then
- walk:Stop(0)
- walk2:Stop(0)
- walk3:Stop(0)
- walk4:Stop(0)
- walk5:Stop(0)
- end
- end
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- local vCharacter = Tool.Parent
- local humanoid = vCharacter.Humanoid
- hold = humanoid:LoadAnimation(Tool.RestingStance)
- walk = humanoid:LoadAnimation(Tool.ForehandStance)
- walk2 = humanoid:LoadAnimation(Tool.ForehandStance1)
- walk3 = humanoid:LoadAnimation(Tool.ForehandStance2)
- walk4 = humanoid:LoadAnimation(Tool.ForehandStance3)
- walk5 = humanoid:LoadAnimation(Tool.RestingStance)
- hold:Play()
- --mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- mouse.KeyDown:connect(onKeyDown)
- mouse.KeyUp:connect(onKeyUp)
- end
- function onUnequippedLocal()
- hold:Stop()
- walk:Stop()
- walk2:Stop()
- walk3:Stop()
- walk4:Stop()
- walk5:Stop()
- hold = nil
- walk = nil
- walk2 = nil
- walk3 = nil
- walk4 = nil
- walk5 = nil
- end
- Tool.Equipped:connect(onEquippedLocal)
- Tool.Unequipped:connect(onUnequippedLocal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement