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: 3 minutes of your time, I'll give you 100 robux.

Previous Thread :: Next Thread 
AIexOvechkin is not online. AIexOvechkin
Joined: 03 Jul 2008
Total Posts: 370
03 Nov 2014 03:19 PM
I have a local script.

function Hybric(key)
local key = key:lower()
if key == "e" then -- change "e" to the Key you want it to be
script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric"
end
end

script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)

what this script does is it plays an animation when a player presses "e"
I was wondering, what do I need to add to this script to make the animation STAY when you're holding it
for example if I press "e" with the script I have above, it will play the sitting animation for 1 second and then stop.
what would I need to do to make it so that if the player HOLDS e, it will make the animation play and not finish until the player releases the button.
sorry if it's confusing but it seems easy to do I just don't know if it requires a script or an actual animation reform.

will pay 100 robux for anyone who solves this, I will pay you the money first if you'd like, I don't see anyone taking more than 5 minutes doing this so try it if you want 100 robux!
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
03 Nov 2014 03:22 PM
function Hybric(key)
local key = key:lower()
if key == "e" then -- change "e" to the Key you want it to be
while key == "e" do
script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric"
wait() -- you have to edit this if your animation keeps resetting and wont play threw
end
end
end

script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
03 Nov 2014 03:23 PM
I'm a beginner but I think you need to use

for - do thing
for loop thingy
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
03 Nov 2014 03:25 PM
function Hybric(key)
local key = key:lower()
if key == "e" and not active then -- change "e" to the Key you want it to be
active = true
while active and wait() do
script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric"
end
end
end

script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)

script.Parent.Parent:GetMouse().KeyUp:connect(function(key)
if key:lower() == "e" then
active = false
end
end)
Report Abuse
AIexOvechkin is not online. AIexOvechkin
Joined: 03 Jul 2008
Total Posts: 370
03 Nov 2014 03:30 PM
1st script was good but even if u let go of the key, it still played the animation and the wait() was a problem, thank you for helping me anyway

2nd post, I'm a beginner too, no idea what loop means T_T

3rd post - thank you this is the one I am looking for, you aren't BC so I don't know how I could give you your 100 robux, you could make your game cost 100 robux to play but you will only get 10 robux from that or you can tell me who to give the 100 robux to
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
03 Nov 2014 04:03 PM
I have a donation system in my game
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
03 Nov 2014 04:40 PM
rip off u should of made it 500 bux
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