| |
|
»
»
|
|
| |
Re: KeyDown() help
|
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 03:51 AM |
In a localscript, this is what I have. (this is only one part of it)
plrmouse.KeyDown:connect(function(key) if key == "q" then if not open then script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -200, 0, 250), "Out", "Sine", nil, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -55, 0, 150), "Out", "Sine", nil, true) script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Sine", 0.7, true) script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, -10), "Out", "Sine", 0.7, true) open = true return end if key == "q" then if open then script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 1.5, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -200, 0, 150), "Out", "Sine", nil, true) open = false end end end end)
After pressing the q key, a guide frame would pop up.
+=+=+=+=+
When having the guide frame, up, it would take the user to double tap the e key to open up the shop, and close the guide frame.
plrmouse.KeyDown:connect(function(key) if key == "e" then if not open then script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -55, 0, 250), "Out", "Sine", nil, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -200, 0, 150), "Out", "Sine", nil, true) script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 0.7, true) script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, -10), "Out", "Sine", 0.7, true) open = true return end if key == "e" then if open then script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 1.5, true) script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -200, 0, 250), "Out", "Sine", nil, true) open = false end end end end)
+=+=+=+=+
Any help? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2014 04:07 AM |
| wait what?? Explain what you want it to do and what is not working noone here is a mind reader |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 03:22 PM |
So you're saying you did not see my explanation on what it does, and what's wrong with?
It's in the post. Please read it carefully. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
|
| 21 Aug 2014 03:43 PM |
| You're explaining what's happening or you're explaining the intended result. I can't tell which it is. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 03:46 PM |
When having the guide frame up, it would take the user to double tap the e key to open up the shop, and close the guide frame.
^^^
So when pressing q, a guide will come up.
After doing so, it would take the user to double tap the e key in order to open up the shop, and close the guide.
Is there a way to fix it, so it would take the user to tap the e key only once? |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 08:52 PM |
b4
so, this one's going to be ignored again like my other post that i made 4 weeks ago? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2014 09:00 PM |
plrmouse.KeyDown:connect(function(key) if key == "q" then if not open then script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -200, 0, 250), "Out", "Sine", nil, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -55, 0, 150), "Out", "Sine", nil, true) script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Sine", 0.7, true) script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, -10), "Out", "Sine", 0.7, true) open = true else script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 1.5, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -200, 0, 150), "Out", "Sine", nil, true) open = false end elseif key == "e" then if not open then script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -55, 0, 250), "Out", "Sine", nil, true) script.Parent.button_frame.guide_button:TweenPosition(UDim2.new(0, -200, 0, 150), "Out", "Sine", nil, true) script.Parent.guide:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 0.7, true) script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, -10), "Out", "Sine", 0.7, true) open = true else script.Parent.shop:TweenPosition(UDim2.new(0, 0, 0, 1500), "Out", "Linear", 1.5, true) script.Parent.button_frame.shop_button:TweenPosition(UDim2.new(0, -200, 0, 250), "Out", "Sine", nil, true) open = false end end end)
Oplz. Use "Else" and "Elseif" instead of that unorganized mess. I fixed the organization problem, but I don't know what the error is.
You didn't tell us the output, if any, and you didn't tell us how it behaves. "Here's my code, here's what I want it to do, fix it" doesn't work. We won't re-write your code completely, we will only find the error. But we don't know how it is behaving... I mean, we might be able to test it, but it won't be the same, and it would use our time. |
|
|
| Report Abuse |
|
|
ZQFMGB12
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 208 |
|
|
| 21 Aug 2014 09:01 PM |
| Why are there two 'plrmouse.KeyDown:connect(function(key)'s ? You only need one. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
| |
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 09:04 PM |
@jarod
> You didn't tell us the output, if any, and you didn't tell us how it behaves.
there aren't any.
Also, thanks. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 21 Aug 2014 09:07 PM |
The script didn't help.
It did work- but nothing changed. the player still needs to double tap the e key to open up the shop. |
|
|
| Report Abuse |
|
|
ZQFMGB12
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 208 |
|
|
| 21 Aug 2014 09:10 PM |
| why double tap e? why not just single tap? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2014 09:14 PM |
local open = false
Put that at the top and test. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 22 Aug 2014 11:27 AM |
@ZQF
No, the error is that it requires e to be tapped twice in order for the shop to come up.
I need it so it does the opposite. |
|
|
| Report Abuse |
|
|
ZQFMGB12
|
  |
| Joined: 07 Aug 2010 |
| Total Posts: 208 |
|
|
| 22 Aug 2014 11:52 AM |
| Can you write me a pseudo code? I think I might see a logical error, but I am having trouble figuring out what the TweenPositions are doing to your guis. To re-write it, just re-write the entire code and replace the lines with :TweenPosition to something like 'Gui A move on screen', 'Gui B move out of the screen,' etc. (replace Gui A and Gui B with a description of your gui) |
|
|
| Report Abuse |
|
|
|
| |
|
|
| |
|
»
»
|
|
|
|
|