generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Stop Animation

Previous Thread :: Next Thread 
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:16 PM
Please, if someone is going to post stupid replies, please don't reply.

Does someone knows how to stop a animation( with welds ) when it's being executed?
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:29 PM
bump
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
24 Dec 2013 07:31 PM
I believe that bumping would be a stupid reply because you are not replying that you have solved the solution yourself or updated your conflict.
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:34 PM
""""Please, if someone is going to post stupid replies, please don't reply.""""
Do you read that?
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
24 Dec 2013 07:38 PM
Yes, I did read that. I was just replying how you can't seem to follow by your own rules. I do know that I am not assisting on your conflict, but if you need help in this forum, you will need to provide a broken script or at least a scripting question.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Dec 2013 07:40 PM
@Per
He asked a scripting question...
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:43 PM
I thought this Forum was for helping.
But probably not...
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
24 Dec 2013 07:44 PM
Yes, but it was too vague. How are we supposed to know what animation he's trying to stop. Plus, you can't stop animations with scripts. Animations are part of ROBLOX, they will always be there. The only way not to have animations is to create a false person that is a replica of the original user, but this would be very hard because you would then have to recreate the animations that you do need such as walking.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Dec 2013 07:45 PM
@Per
Actually there a client-sided script in the roblox character that can easily be disabled. Plus, he said weld animations. I don't think what he was saying was too vague to be honest.
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:46 PM
My "animations" are with Welds and Motors, i just want to stop an freaking animation before it finished.
It's just THAT!
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
24 Dec 2013 07:46 PM
@Josh
Well if you know everything about what he's talking about. Why not answer the question?
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
24 Dec 2013 07:47 PM
shon before you say that from the perspective of one person and perpetual is a good script and a good helper, i found his post a bit funny just "don't judge a book by it's cover"

also, with the animation do you want it to play again after you pause the animation but also I don't think you can stop the animation with welds unless you pause the animation(I think you can do it: anim:Play()/anim:Pause() idk possibly)
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:48 PM
Again...
My "animations" are with welds and motors.
Report Abuse
qrrrq is not online. qrrrq
Joined: 27 Jan 2013
Total Posts: 1252
24 Dec 2013 07:49 PM
@OP, there is no way to do this without making code that checks values.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Dec 2013 07:49 PM
Shon, if I where you I would make every animation a coroutine, keep a table if it, then do a pcall() stopping every one of them (and clearing them) before starting a new coroutine. Then of course, add that coroutine to the table.
Report Abuse
qrrrq is not online. qrrrq
Joined: 27 Jan 2013
Total Posts: 1252
24 Dec 2013 07:50 PM
haha, I forgot about coroutines.
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 07:51 PM
So how i can code that?
Report Abuse
qrrrq is not online. qrrrq
Joined: 27 Jan 2013
Total Posts: 1252
24 Dec 2013 07:52 PM
http://wiki.roblox.com/index.php/Coroutine
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Dec 2013 07:56 PM
Just assume character and player are defined.


local AnimationCoroutines={}

function WalkAnimation()
local Animation=coroutine.create(function()
-- walking stuff
end)
return Animation
end

Character.Humanoid.Running:connect(function(Speed)
if Speed>0 then
for i,v in pairs(AnimationCoroutines) do
pcall(function() coroutine.yield(v) end)
end
local Animation=WalkAnimation()
table.insert(AnimationCoroutines,Animation)
coroutine.resume(Animation)
end
end)

--This is just an example and should not actually be used .-.

Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 08:40 PM
That's the code:

print("Animating player model.");

local player = game.Players.LocalPlayer;
local user = player.Character;
local head = user.Head;
local running = false;
local rs = user.Torso["Right Shoulder"];
local ls = user.Torso["Left Shoulder"];

function walking(speed)
if speed>0 then
running = true;
else
running = false;
end
end

user.Humanoid.Running:connect(walking);

coroutine.resume(coroutine.create(function()
rs.MaxVelocity = 0.2;
ls.MaxVelocity = 0.2;
while wait(0.1) do
if (running) then
rs.DesiredAngle = rs.DesiredAngle+1;
ls.DesiredAngle = ls.DesiredAngle+1;
wait(0.5) -----------problem
rs.DesiredAngle = rs.DesiredAngle-1;
ls.DesiredAngle = ls.DesiredAngle-1;
elseif (not running) then
coroutine.resume(coroutine.yield())
end
end
end))

But if i put a "wait()" in the function, the coroutine.yield don't stops immediately.
Report Abuse
Shonysky is not online. Shonysky
Joined: 05 Aug 2013
Total Posts: 361
24 Dec 2013 08:41 PM
print("Animating player model.");

local player = game.Players.LocalPlayer;
local user = player.Character;
local head = user.Head;
local running = false;
local rs = user.Torso["Right Shoulder"];
local ls = user.Torso["Left Shoulder"];

function walking(speed)
if speed>0 then
running = true;
else
running = false;
end
end

user.Humanoid.Running:connect(walking);

coroutine.resume(coroutine.create(function()
rs.MaxVelocity = 0.2;
ls.MaxVelocity = 0.2;
while wait(0.1) do
if (running) then
rs.DesiredAngle = rs.DesiredAngle+1;
ls.DesiredAngle = ls.DesiredAngle+1;
wait(0.5)
rs.DesiredAngle = rs.DesiredAngle-1;
ls.DesiredAngle = ls.DesiredAngle-1;
elseif (not running) then
coroutine.yield() -- fixed, sorry, it was wrong
end
end
end))
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image