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 » Scripters
Home Search
 

Re: Starting my JetPack

Previous Thread :: Next Thread 
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
28 Dec 2015 02:10 PM
How do I make it so that when I double tap space and hold down, something happens, for now it can just print something.
This is my failed attempt:

local UIS = game:GetService("UserInputService")
local Human = script.Parent.Parent:WaitForChild("Humanoid")
local Debounce = true
Human.Jumping:connect(function(Jump)
if Debounce == true then
Debounce = false
print ("JetPack?")
UIS.InputBegan:connect(function(key,GPE)
if not GPE and key.KeyCode == Enum.KeyCode.Space and Human.Jump == true then
print ("Jetpack!")
end
end)
else
wait(2)
Debounce = true
end
end)

~IanSplodge, Walrus God of the Forums.
Report Abuse
Phenite is online. Phenite
Joined: 16 May 2010
Total Posts: 158
28 Dec 2015 02:11 PM
Don't put the else there. That will make the wait to debounce occur after the second jump.
Report Abuse
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
28 Dec 2015 02:16 PM
The whole thing is terrible. I want to not use the Jumping function.
Is there a way to do this using only UIS?

~IanSplodge, Walrus God of the Forums.
Report Abuse
IanSplodge is not online. IanSplodge
Joined: 13 Aug 2012
Total Posts: 2686
28 Dec 2015 02:18 PM
Nevermind, got it:
local UIS = game:GetService("UserInputService")
local Human = script.Parent.Parent:WaitForChild("Humanoid")


UIS.InputBegan:connect(function(key,GPE)
if not GPE and key.KeyCode == Enum.KeyCode.Space then
if not GPE and key.KeyCode == Enum.KeyCode.Space and Human.Jump == true then
print ("I'M FLYING!")
end
end
end)

~IanSplodge, Walrus God of the Forums.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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