I’m writing a simple reload script. Here’s the script:
local UserInputService = game:GetService("UserInputService")
local Amunition = 20
local Test = Instance.new("Animation")
Test.AnimationId = "rbxassetid://6587068338"
local Test = Animator:LoadAnimation(Test)
Test.Priority = Enum.AnimationPriority.Action
Test.Looped = false
UserInputService.InputBegan:Connect(function(input, gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.R then
if Amunition < 20 then
Amunition = 20
Test:Play()
end
end
end)
local function Shoot(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
Amunition -= 1
end
end
UserInputService.InputBegan:Connect(Shoot)
But the script has been giving me this error:
Play is not a valid member of Animation "Animation"
Does anyone know how to solve this issue?