|
| 18 Aug 2016 06:33 PM |
local Button = script.Parent local Sidebar = Button.Parent.Sidebar
Button.MouseButton1Down:connect(function() if Sidebar.Visible == false then Sidebar.Visible = true Button.Text = "Close" Sidebar:TweenSizeAndPosition(UDim2.new(0.25, 0,0.9, 0), UDim2.new(0, 0,0, 0), "Out", "Quad", 1) elseif Sidebar.Visible == true then Sidebar.Visible = true Button.Text = "Menu" Sidebar:TweenSizeAndPosition(UDim2.new(0.25, 0,0.9, 0), UDim2.new(0, 0,0, 0), "Out", "Quad", 1) end end)
It is supposed to be a Shop script, This was an old project i have recently found
|
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Aug 2016 06:47 PM |
sp = script.Parent sb = sp.Parent.Sidebar
sp.MouseButton1Down:connect(function() sb:TweenSizeAndPosition((sp.Text == 'Menu' and UDim2.new(0.25, 0,0.9, 0) or UDim2.new(0,0,0,0)), UDim2.new(0, 0,0, 0), 'Out', 'Quad', 1) sp.Text = sp.Text == 'Menu' and 'Close' or 'Menu' end) |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Aug 2016 06:49 PM |
sp.Text = sp.Text == 'Menu' and 'Close' or 'Menu'
Typo or just something I don't understand? ^
|
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Aug 2016 06:50 PM |
"something I don't understand" ^ |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 18 Aug 2016 06:51 PM |
@soy
Typo.
For instance, you can't do
part = workspace.Part:Clone().Parent = game.Lighting |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Aug 2016 06:52 PM |
I thought so but it's Vince and Vince never makes typos :P
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 06:52 PM |
local Button = script.Parent local Sidebar = Button.Parent.Sidebar
Button.MouseButton1Down:connect(function() if Sidebar.Visible == false then Sidebar.Visible = true Button.Text = "Close" Sidebar:TweenSizeAndPosition(UDim2.new(0.25, 0, 0.9, 0), "Out", "Quad") elseif Sidebar.Visible == true then Button.Text = "Menu" Sidebar:TweenSizeAndPosition(UDim2.new(-0.5, 0, 0.9, 0), "Out", "Quad") Sidebar.Visible = false end end) |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Aug 2016 06:52 PM |
"@soy
Typo.
For instance, you can't do
part = workspace.Part:Clone().Parent = game.Lighting"
Ignorant buffoon, it isn't a typo. |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 18 Aug 2016 06:53 PM |
Just kidding, i just noticed that its two ='s.
gg. |
|
|
| Report Abuse |
|
|
frriend
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 577 |
|
|
| 18 Aug 2016 06:53 PM |
| And you need to relax, its nothing to get all angry over. I was wrong and i admit that. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Aug 2016 06:58 PM |
I see the double equals but I can't translate it. My brain reads it as:
Text equals Text is equivalent to "Menu" and "Close" or "Menu"
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 06:58 PM |
| Can you explain to us simple mortals what your script does? Because I can barelly understand a half of it by using simple logic. |
|
|
| Report Abuse |
|
|
| |
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 18 Aug 2016 07:00 PM |
sp.Text = sp.Text == 'Menu' and 'Close' or 'Menu'
Is the same thing as doing this:
if sp.Text == 'Menu' then sp.Text = 'Close' else sp.Text = 'Menu' end
Much more efficient and looks nicer. |
|
|
| Report Abuse |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 18 Aug 2016 07:04 PM |
^ I'm assuming he means keystroke efficiency.
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:04 PM |
@Imeatingpoorrightnow Roblox wiki can't learn us crap, the lua documentation is too long and the books too expensive. Therefore I ask others that know better than me.
@DevVince Thanks! |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:05 PM |
^ http://wiki.roblox.com/index.php?title=AllTutorials
Also you just dont know how to use the Wiki |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:06 PM |
"Roblox wiki can't learn us crap" I suggest learning how to type in English, your sentence makes no sense.
"the lua documentation is too long" You're too stupid.
"the books too expensive." lua.org/pil/contents.html
'Too expensive' literally a free book, you're too stupid[2] |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:06 PM |
| It is weird and it is in no way more efficient than anything else, but it still does look a lot more cleaner when you shrink 5 lines into a single one. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:08 PM |
"It is weird" You're too stupid[3]
"and it is in no way more efficient than anything else" Actually it's about 12% more efficient. You can increase this 24% if you use semicolons.
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:09 PM |
| @Daily, it isn't the easiest thing to use when you want to get deep. Since it goes over the basics quite well, also the tutorials should be redone into FE. To allow a understanding of it from the start, but again its ROBLOX... |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:10 PM |
^ If you understand English then reading shouldn't be hard If you are in high school (like me) then the math should be no problem |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 07:11 PM |
"also the tutorials should be redone into FE" Nope, you should stop being so stupid and understand how FE works.
|
|
|
| Report Abuse |
|
|