i made the animations, and its not a group game (localscript in starterplayerr)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ViewModelManager = require(ReplicatedStorage.Managers:WaitForChild("ViewModelManager"))
local AnimationManager = require(ReplicatedStorage.Managers:WaitForChild("AnimationManager"))
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local StarterGui = game.StarterGui
local BindableEvent = ReplicatedStorage:WaitForChild("Parte1")
local function playAnimation()
ViewModelManager:DestroyViewModel()
local ViewModel, Gunmodel = ViewModelManager:CreateViewModel("VM_apanhar")
local animations = AnimationManager:LoadAnimations(ViewModel, { "ApanharItem" })
local abrirPortaAnimation = animations.ApanharItem
abrirPortaAnimation:Play()
abrirPortaAnimation.Stopped:Connect(function()
ViewModelManager:DestroyViewModel()
local defaultViewModel, _ = ViewModelManager:CreateViewModel("VM_lanterna")
ViewModelManager:BindViewModel(defaultViewModel)
local defaultAnimations = AnimationManager:LoadAnimations(defaultViewModel, { "Lanterna" })
if defaultAnimations.Lanterna then
defaultAnimations.Lanterna:Play()
end
local flashlightScriptTemplate = StarterGui:WaitForChild("flv")
local clonedFlashlightScript = flashlightScriptTemplate:Clone()
clonedFlashlightScript.Parent = player.Character
end)
ViewModelManager:BindViewModel(ViewModel)
end
player.CharacterAdded:Wait()
local proximityPrompt = workspace:WaitForChild("CartaoGiver"):WaitForChild("ProximityPrompt")
proximityPrompt.Triggered:Connect(function(player)
playAnimation()
end)