script below. The animation does not play, and before you ask,
-Yes the animation is looped
-Yes the animation is set to action priority
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local model = require(game.ReplicatedStorage.odm).CreateModel(game.Players.LocalPlayer)
local mouse = game.Players.LocalPlayer:GetMouse()
local tws = game['TweenService']
local lefthooked = false
local righthooked=false
local doublehook = false
local camera
repeat task.wait() until workspace.CurrentCamera
camera = workspace.CurrentCamera
print(model)
local animator = character:WaitForChild('Humanoid'):WaitForChild('Animator')
local rmT = animator:LoadAnimation(script.mRight)
local lmT = animator:LoadAnimation(script.mLeft)
local dmT = animator:LoadAnimation(script.doublem)
local function KeyDown(key)
if key == 'e' and (mouse.Hit.p - character.HumanoidRootPart.Position).Magnitude <= 300 then
if not lefthooked then
model:CreateHook('Right', mouse.Hit.p)
righthooked = true
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 100}):Play()
rmT:Play()
end
if lefthooked then
model:findDouble(mouse.Hit.p, 'Right')
righthooked = true
rmT:Stop()
lmT:Stop()
dmT:Play()
end
return
end
if key == 'q' and (mouse.Hit.p - character.HumanoidRootPart.Position).Magnitude <= 300 then
if not righthooked then
model:CreateHook('Left', mouse.Hit.p)
lefthooked = true
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 100}):Play()
lmT:Play()
end
if righthooked then
model:findDouble(mouse.Hit.p, 'Left')
lefthooked = true
doublehook = true
lmT:Stop()
rmT:Stop()
dmT:Play()
end
return
end
if key == 'a' then
if lefthooked or righthooked then
model:Turn('Left')
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(-1.5, 0, 0)}):Play()
return
end
end
if key == 'd' then
if lefthooked or righthooked then
model:Turn('Right')
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(1.5, 0, 0)}):Play()
return
end
end
if key == ' ' then
if righthooked or lefthooked then
model:StartBoost()
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 120}):Play()
end
end
end
local function KeyUp(key)
if key == 'e' then
model:DestroyHook('Right')
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 70}):Play()
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(0, 0, 0)}):Play()
model:EndDouble()
model:endTurn('Right')
model:endTurn('Left')
model:EndBoost()
rmT:Stop()
righthooked = false
if doublehook then
doublehook = false
model:EndDouble()
dmT:Stop()
end
return
end
if key == 'q' then
model:DestroyHook('Left')
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 70}):Play()
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(0, 0, 0)}):Play()
model:EndDouble()
model:endTurn('Right')
model:endTurn('Left')
model:EndBoost()
lefthooked = false
lmT:Stop()
if doublehook then
doublehook = false
dmT:Stop()
model:EndDouble()
end
return
end
if key == 'a' then
if lefthooked or righthooked then
model:endTurn('Left')
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(0, 0, 0)}):Play()
return
end
end
if key == 'd' then
if lefthooked or righthooked then
model:endTurn('Right')
tws:Create(character.Humanoid, TweenInfo.new(.4), {CameraOffset = Vector3.new(0, 0, 0)}):Play()
return
end
end
if key == ' ' then
if righthooked or lefthooked then
model:EndBoost()
tws:Create(camera, TweenInfo.new(.6), {FieldOfView = 100}):Play()
end
end
end
mouse.KeyDown:Connect(KeyDown)
mouse.KeyUp:Connect(KeyUp)