You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to animation stop and destroy when proximity prompt triggered
-
What is the issue? Include screenshots / videos if possible
it gives me an error:
Stop is not a valid member of Animation "StarterPlayer.StarterPlayerScripts.TakePizza.Animation"
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to create animation from instance but animation won’t stop playing nor destroying
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
this is my script:
local hrp = script.Parent
local event = game.ReplicatedStorage.Remotes:WaitForChild("GiveCharPizzaEvent")
hrp.ProximityPrompt.Triggered:Connect(function(player)
local char = player.Character or player.CharacterAdded
local hum = char:WaitForChild("Humanoid")
player.leaderstats.Money.Value = player.leaderstats.Money.Value + 15
event:FireClient(player)
print(event)
wait(0.5)
hrp.Parent:Destroy()
local animation = game.StarterPlayer.StarterPlayerScripts.TakePizza.Animation
animation:Stop()
end)
I t will be great help if anyone could help me solve this

thank you
