So currently im trying to make a fps viewmodel, it shows up, but the animations aren’t loading, its going through all the prints but not loading the animations, any ideas?
ViewModelTest.rbxl (70.6 KB)
local player = game.Players.LocalPlayer
local char = player.Character
local cam = workspace.Camera
local run = game:GetService("RunService")
local arms = game.ReplicatedFirst.FPSARMS:Clone()
local MyGun = script.Parent
local GunHandle = MyGun:WaitForChild("Handle")
arms.Parent = cam
MyGun.Equipped:Connect(function()
print("Tool Equiped 1")
local Animation = arms:WaitForChild("Animation")
local humanoid1 = arms:WaitForChild("Humanoid")
local loadAnimation = humanoid1:LoadAnimation(Animation)
print("about to hit play")
loadAnimation:Play()
print("hit play")
local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
FPSARMS.LeftArm.Transparency = 0
FPSARMS.RightArm.Transparency = 0
print("got past hit play")
GunHandle.Transparency = 1
print("got past hit play2")
local Humanoid = arms.Humanoid
local Animation = arms.Animation
local LoadAni = Humanoid:LoadAnimation(Animation)
LoadAni:Play()
print("got past hit play3")
local GunModel = FPSARMS.GunModel:GetChildren()
print("got past hit play4")
for i, value2 in pairs(GunModel) do
print("got past hit play5")
value2.Transparency = 0
end
print("got past hit play6")
end)
if MyGun.Equipped then
print("got past hit play7")
arms.Parent = cam
run.RenderStepped:Connect(function()
arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,-1.6,-2.5) * CFrame.Angles(0,1.5,0))
end)
print("got past hit play8")
end
MyGun.Unequipped:Connect(function()
print("got past hit play9")
local Humanoid = arms:WaitForChild("Humanoid")
print("got past hit play10")
local Animation = arms:WaitForChild("Animation")
print("got past hit play11")
local loadAnimation = Humanoid:LoadAnimation(Animation)
loadAnimation:Stop()
arms.Parent = cam
print("got past hit play12")
local FPSARMS = game.Workspace.Camera:WaitForChild("FPSARMS")
FPSARMS.LeftArm.Transparency = 1
FPSARMS.RightArm.Transparency = 1
print("got past hit play13")
local GunModel = FPSARMS.GunModel:GetChildren()
print("got past hit play14")
for i, value in pairs(GunModel) do
print("got past hit play15")
value.Transparency = 1
end
end)