I made a script which users proximity detector to take or drop a part, now i only need a way to play a different walk and idle animation when the part is attached to the player, just i don’t have idea of how to do that, changing the default animations make the TakeAnimation start anytime and can’t switch on default one when is dropped.
What u mean? Changing the animations on the Animate script, launches someway your own animation called TakeAnimation?
When the part attached is dropped, you cant change the default animation on Animate script?
Maybe you need to paste ur script to understand what u mean.
So using a proximity event, you are welding a part to the player, on that event you want to change the Walking and Idle animations on Default Animate script, then, on another proximity event, you want to unweld the part, restore default animation id’s on Animate Script. And thats it right?
I mean, changing the Animate LocalScript from the character and pasting it in the StarterScript makes the Animation i set as Default when you spawn, like changing from normal walk to Zombie walk will just make the player use the Zombie walk animaton becoming the default animation
I have no idea on how switch the Walk animation from Default to BoxTaken for example and viceversa
Script
for i,v in ipairs(script.Parent:GetChildren()) do
local taken = false
if v.Name == "Trash" then
while wait(0.1) do
if taken == false then
v.TakePrompt.Triggered:Connect(function(Player)
v.WeldConstraint.Part0 = v
local Plr = workspace:FindFirstChild(Player.Name)
v.WeldConstraint.Part1 = Plr.RightHand
v.PromptStorage.DropPrompt.Parent = v
v.TakePrompt.Parent = v.PromptStorage
taken = true
end)
end
end
end
end
NOTE: This should work as script but is 90% the one i’m using, i’m from phone and is 5AM and i have the updated version on pc, i’ll publish that on moving if needed.
Yeah you are right, the script does all of it but i only need the Animation switch script or a way to do that.
Theres no need to copy the Animate Script, and paste it on Player Scripts, just get the script instance and change the parameters inside:
Change the Run Animation (do it on your event):
local Players = game:GetService("Players")
local localPlaya = Players.LocalPlayer
local animateScript = localPlaya .Character:WaitForChild("Animate")
animateScript.run.RunAnim.AnimationId = "rbxassetid://0000000000" -- Set a Custom Run Animation
Restore the Run animation (do it on another event)
local animateScript = localPlaya.Character:WaitForChild("Animate")
animateScript.run.RunAnim.AnimationId = "rbxassetid://913376220" -- Restore Original/Default Roblox Run Animation
You can store the ID’s of the player’s animation on a table too, so u can restore the default animations they had if you dont wanna hardcode each one "rbxassetid://913376220"
EDIT: Notice that the Animate Script has string values, with animations inside, just access them via script and change the id’s, so the Animate Script will use them