Hello , I’m trying to achieve a proximity prompt when a player does an animation Ex /me surrenders the animation begins and the proximity prompt is enabled allowing another person to “rob” him/her taking random amounts of money and some tools.
I tried searching youtube and the forums but couldn’t find anything
Alright, so Im assuming that you are playing your animation with a script.
First make your proximity prompt and place it in replicated storage.
Inside of your script, make a clone of the proximity prompt and parent it to the player. That should be it
Heres an example
VVVVVVVVVVV
--Animation PLays part
local PPrompt = game.replicatedstorage.NameOfYourPrompt
PPrompt.Parent = script.parent --Add more parents based off your heirarchy
elseif string.match(msg,"texts") or string.match(msg,"texting") or string.match(msg,"Text") or string.match(msg,"Texting") or string.match(msg,"Texts") then
local anim = Player.Character.Humanoid:LoadAnimation(script.texting)
local sound = script.Sound:Clone()
sound.Parent = Player.Character.Head
sound:Play()
game.Debris:AddItem(sound,sound.TimeLength)
anim:Play()
yea, but the animation script is separated from the proximity prompt though
No, the anim only plays once so it can be inside.
It would look like
local anim = Player.Character.Humanoid:LoadAnimation(script.texting)
local sound = script.Sound:Clone()
sound.Parent = Player.Character.Head
sound:Play()
game.Debris:AddItem(sound,sound.TimeLength)
anim:Play()
local PPrompt = game.replicatedstorage.NameOfYourPrompt
PPrompt.Parent = script.parent --Add more parents based off your heirarchy