|
So I posted about an hour ago asking why my animations werent working, I fixed that but I have another issue now.
game.Players.PlayerAdded:connect(function(player)
while not player.Character do wait() end
local character = player.Character
local animateScript = character.Animate
animateScript.walk.WalkAnim.AnimationId = 'http://www.roblox.com/asset/?id=410422188'
end)
That's the script I'm using. When I play the game, this and my other custom animations (jumping and falling) work like a charm. However, when I die, upon respawn, the animations are overwritten with the ROBLOX defaults. Why? |
|
|
By the way, if you want to see this glitch in-game, go on my profile and go to my only game, called BloxRunners. |
|
|
because, you dont have an event to continue the animation when the player dies.
the current code only works if the player is alive.
So you have two options, avoid death by simply creating your own health property and not affecting the humanoid property.(tons of work)
or just adding the same code for onDeath function. for humanoid. |
|
|
Alright, ill try this now. Thanks! |
|
|
How do I use the onDeath function in the script? I'm not all that good at scripting (can only make VERY basic things). |
|
|
|
flumpbump
Anybody wanna help? Please? |
|
|
Everybody else getting loads of help and im just sat here.
Thanks for being a great community. :c |
|
|
|
How am I supposed to use it? Would it be like
game.Players.PlayerAdded:connect(function(player)
player.CharacterRemoving:connect(function(character)
while not player.Character do wait() end
local character = player.Character
local animateScript = character.Animate
animateScript.walk.WalkAnim.AnimationId = 'http://www.roblox.com/asset/?id=410422188'
end) |
|
|
Argh, need help!
Dont just make it short either, actually give a script example please! :( |
|
|
actually, you use character Added, just put that animation stuff in the characterAdded event
so, it would go something like this
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char.Humanoid.Running:connect(function(charSpeed)
if(charSpeed> 0.01) then
-- do running animation
else
-- do standing animation
end
end)
end)
end) |
|
|
Thanks so much! How would it work for the jumping animation I have though?
JumpingAnim Script in serverscriptstorage:
game.Players.PlayerAdded:connect(function(player)
while not player.Character do wait() end
local character = player.Character
local animateScript = character.Animate
animateScript.jump.JumpAnim.AnimationId = 'http://www.roblox.com/asset/?id=410430422'
end)
Its exactly the same as the walking animation except, you know, for jumping. |
|
|
Nevermind, I managed to fix the jump animation with a seperate script. Thanks for your help <3 |
|