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: My script is a tad broken. How do i work around this?

Previous Thread :: Next Thread 
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
30 Aug 2013 04:15 PM
Using an already existing flight script, i've attempted to modify it to allow for an animation to be played when no key inputs are recieved, an idle animation of sorts.

However my limited knowledge of scripting leads to the animation becoming stuck and bugging out, due to the continous triggering of an "if". How do i work around this?

What i currently have:

if controls.right==0 and
controls.left==0 and
controls.backward==0 and
controls.forward==0 then
glideanim=humanoid:LoadAnimation(anim2)
glideanim:Play()
else
glideanim:Stop()
flyanim=humanoid:LoadAnimation(anim)
end
-------------------------
Obviously, the "if" is continously being triggered when i'm not moving,
causing it to continously load and play the animation.
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
30 Aug 2013 04:21 PM
Bump. :\
Report Abuse
adammthomas2000 is not online. adammthomas2000
Joined: 24 Feb 2013
Total Posts: 454
30 Aug 2013 04:43 PM
Try using debouce. It prevents listeners from being used multiple times at once.

Example:

debounce = false

onTouched()
if debouce = false then
debounce = true

If blah blah blah blah then
blah blah blah blah
blah blah blah blah
blah blah blah blah
end
debounce = false
end

If that makes no sense, look it up on Wiki.
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
30 Aug 2013 04:54 PM
That didn't help, seeing as i had already tried that. >_<

I really need some kind of workaround..
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
30 Aug 2013 05:14 PM
Bump.
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
31 Aug 2013 04:03 AM
Bump.
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
31 Aug 2013 05:15 AM
Bump. Anyone?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
31 Aug 2013 05:22 AM
If I were you I would make a play button that loads the animation tbh,
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
31 Aug 2013 05:26 AM
Wait, what? What does this have to do with fixing the animation issues?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
31 Aug 2013 05:28 AM
You said that the animation is loading every time the player doesn't move. So just make the animation load on different conditions.
Report Abuse
kanza is not online. kanza
Joined: 09 Nov 2008
Total Posts: 3260
31 Aug 2013 05:40 AM
I'm by no means adept at scripting, so i'll be blunt; i have no clue what you specifically mean by that. >_<
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