so i have this localscript for a viewmodel i have and im hearing im using outdated, deprecated code for my animation. can someone tell me exactly how i should type it instead? its not working for me currently
local player = game.Players.LocalPlayer
local char = player.Character
local cam = workspace.Camera
local run = game:GetService("RunService")
local arms = game.ReplicatedFirst.DeagleViewModel:Clone()
local MyGun = script.Parent
local GunHandle = MyGun:WaitForChild("Handle")
arms.Parent = cam
MyGun.Equipped:Connect(function()
local FPSARMS = game.Workspace.Camera:WaitForChild("DeagleViewModel")
FPSARMS.LeftArm.Transparency = 0
FPSARMS.RightArm.Transparency = 0
GunHandle.Transparency = 1
local anim = script.ShootAnim
local Humanoid = arms.Humanoid
local LoadAni = Humanoid:LoadAnimation(anim)
LoadAni:Play()
local GunModel = FPSARMS.Deagle:GetChildren()
for i, value2 in pairs(GunModel) do
value2.Transparency = 0
end
end)
if MyGun.Equipped then
arms.Parent = cam
run.RenderStepped:Connect(function()
arms:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(0,-2,0) * CFrame.Angles(0,0,0))
end)
end
MyGun.Unequipped:Connect(function()
arms.Parent = cam
local FPSARMS = game.Workspace.Camera:WaitForChild("DeagleViewModel")
FPSARMS.LeftArm.Transparency = 1
FPSARMS.RightArm.Transparency = 1
local GunModel = FPSARMS.Deagle:GetChildren()
for i, value in pairs(GunModel) do
value.Transparency = 1
end
end)
no like i have the animation in my roblox game, with the id and whatever but i cant open it with the editor probably cause i didnt make it through there