Could you show me how I would do that? I’m pretty new to scripting
Yes, that’d be appreciated!
(30 chars)
K, starting recording soon… (30 chars)
@MichaelEpicA Michael try to reduce the amount of post your making, it clutters the topic more than it needs to be…
You didn’t parent the “run” animation instance to anything.
try parenting it to the humanoid by replacing,
local run = Instance.new("Animation")
with
local run = Instance.new("Animation", Humanoid)
Line 3
Server script
local RemoteEvent = game:GetService("ReplicatedStorage").EditWalkAnimation
local defaultanimid = "rbxassetid://913402848"
RemoteEvent.OnServerEvent:Connect(function(player,walkanim)
if walkanim == false then
player.Character.Animate.walk.WalkAnim.AnimationId = defaultanimid
else
player.Character.Animate.walk.WalkAnim.AnimationId = "rbxassetid://"
end
end)
local RemoteEvent = game:GetService("ReplicatedStorage").EditWalkAnimation
local activated = false
local UserInputService = game:GetService("UserInputService")
UserInputService.InputEnded:Connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.E then
RemoteEvent:FireServer(activated)
activated = not activated
end
end)
Local script, just an example.
So, it would change the animation on when I press W with the Tool equipped, and then set the anims to default when I unequip it, or is that not implemented in your script?
Ok, if you don’t know how to use remote events try looking it up on devhub. Its got great explanations there.
We already fixed the animation bug by the way.
Now we have to use remote events to revert it back and stuff.
Could u show us the errors?
30 charrs
Try reuploading the animation as Action if you didn’t already, because LocalScripts seem to fail in setting the AnimationPriority.
If the bat has multiple parts. Make sure you weld them to the Handle, and don’t forget to UnAnchor all the parts.
The code’s a bit hard to read, if you could use roblox’s default format for posting on the devforum, I’d greatly appreciate it.
Hey, I already told you, we pretty much fixed the issues currently, we are just working on remote events right now.
You may have told me, but the code is still hard to read. What is exactly the issue right now.
The issue right now, is we are trying to make an animation play when a W key is held down aka when the character is walking and once they stop, we stop the animation, now in order to do this we had to change the walk animation, now we have to set it back on the server, so we have to use remote events to change it back and forward.
Simplified: Basically I have a tool that when you press W with it, it gives a unique walk animation. When I de equip it, the animation still plays whenever I press W, and the tool doesn’t disappear
You don’t need remote events when dealing with animations. Animations should be handled locally with Humanoid:LoadAnimation() or AnimationController:LoadAnimation.
When the player presses or holds W, make the animation play,
UserInputService.InputBegan:Connect(function(keyPressed, gameProcessed)
if gameProcessed then return end
if keyPressed.KeyCode = Enum.KeyCode.W then
Animation:Play()
repeat
wait()
until not UserInputService:IsKeyDown(Enum.KeyCode.W)
Animation:Stop()
end
end)
No, we are talking about changing the walk animation, not just a random animation.
Yeah, the animation plays on holding W, but I need it to revert to the normal roblox default animation when I de equip it, and the tool doesn’t disappear so it looks like theres a bat in your torso
If you need, I can send you the new script details.
@warycoolio like this best way to do this would just to use a remote event that changes it to a new walk animation.
Your extremely confusing, so when the player plays the animation with W, you want to keep the animation going until they un-equip the tool?
If you want to keep it going until they stop holding W, use the script I made above.
No, what he means the walk animation will be set, and then once its unequipped, the walk animation will be set back to default, it makes so much sense for me.