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: I need help with this script

Previous Thread :: Next Thread 
Slayinq_Ethan is not online. Slayinq_Ethan
Joined: 02 Dec 2011
Total Posts: 27
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 is not online. 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 is online. 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 is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
18 Aug 2016 06:50 PM
"something I don't understand"
^
Report Abuse
Soybeen is online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
18 Aug 2016 06:51 PM
What is it saying?


Report Abuse
frriend is not online. 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 is online. 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
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
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 is not online. 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 is not online. 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 is not online. 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 is online. 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
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
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
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
18 Aug 2016 07:00 PM
Learn to script then.
Report Abuse
DevVince is not online. 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
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
18 Aug 2016 07:01 PM
"Much more efficient"

LOL
Report Abuse
Soybeen is online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
18 Aug 2016 07:04 PM
^ I'm assuming he means keystroke efficiency.


Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
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
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
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
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
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
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
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
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