Categories > Coding > Lua >
Animation script issue
Posted
I wrote a script to change animations in the game, but after the character dies,
I try to press the change button and nothing happens, only restarting the script helps
can you suggest quick fix
Replied
The animations are based on the Humanoid And HumanoidRootPart, It's destroyed when you're character dies so I'd prefer you create a gui to execute the script from within the game. Or else you could modify the script to re-execute the script when HumanoidRootPart is destroyed.
In order to do that you can put the script in a function and put a while true do under the function
You can use if not if it still works in the script below. I'm not sure if this is relevant though.
function Build()
--script here
end
while true do
if game.Players.LocalPlayer.Character.HumanoidRootPart then
--Do nothing cause you haven't died.
else
Build() -- Rexecute script
end
end
Cancel
Post
I bet you a dollar you saw this.
Replied
Giving us your current script would possibly help fixing your script.
Cancel
Post
Random quote here...
Replied
Cancel
Post
Added
@VoidableMethod damn, my code is bad because not so long ago I started writing scripts lol. I doubt that anything will help me but I can send you a script so that you can tell me how to solve this problem.
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post