Hi there,

I’ve got this module script that runs when Prompts are began/ended i’ve got it to play an animation when prompt begins but i can’t seem to find a way to make the animation :Stop() when the prompt ends because the animation is outside the scope and says Unknown global so I’m not sure what the work around is,

Script:

local SS = game:GetService("ServerScriptService")
local anims = SS:WaitForChild("LootingAnims")

local ObjectActions  = {}

function ObjectActions.promptHoldBeganActions(promptObject, player, looting)
	if looting == true then
	local lootinganim =
		{
			anims:WaitForChild("Looting"),
		}
	
		local char = player.Character
		local human = char:WaitForChild("Humanoid")	
		local lootingAnim = human:LoadAnimation(lootinganim[1])
		lootingAnim:Play() -- Animation
	end
end

function ObjectActions.promptHoldEndedActions(promptObject, player, looting)
	print ("Ended") -- Stop Animation here
end

return ObjectActions

Thanks,