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: What's wrong with this script?

Previous Thread :: Next Thread 
jojods1125 is not online. jojods1125
Joined: 27 Sep 2011
Total Posts: 11253
09 Mar 2014 09:12 AM
I have the "script.Parent.Parent" correct. I made a note next to the line that Roblox says is wrong.


local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == {0,200},{0,55} then --This line is underlined in red. Why?
BlueBox.Size = {0,55},{0,55}
elseif BlueBox.Size == {0,55},{0,55} then
BlueBox.Size = {0,200},{0,55}
end
end)


Thanks to whoever helps! :)
Report Abuse
SuperMushroom8 is not online. SuperMushroom8
Joined: 26 Feb 2010
Total Posts: 15520
09 Mar 2014 09:15 AM
press enter
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:17 AM
Isn't size a UDim2 value?
Report Abuse
jojods1125 is not online. jojods1125
Joined: 27 Sep 2011
Total Posts: 11253
09 Mar 2014 09:18 AM
@super

You mean after "end)"? Or after the first "then"?
Report Abuse
jojods1125 is not online. jojods1125
Joined: 27 Sep 2011
Total Posts: 11253
09 Mar 2014 09:18 AM
@cool

I'm not entirely sure, as I'm not expert at this, but I believe so. What would I have to do differently because of that?
Report Abuse
SuperMushroom8 is not online. SuperMushroom8
Joined: 26 Feb 2010
Total Posts: 15520
09 Mar 2014 09:18 AM
after the first "then"

if that doesnt work then try AFTER the "end"
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:19 AM
Ok you have to change it to UDim2.new(0, 200, 0, 55), I think
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:20 AM
local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == "{0,200},{0,55}" then
BlueBox.Size = UDim2.new("{0,55},{0,55}")
elseif BlueBox.Size == {0,55},{0,55} then
BlueBox.Size = UDim2.new("{0,200},{0,55}")
end
end)

I am not exactly sure, I don't use UDim2's much
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:20 AM
warspyking thats what I said.
Report Abuse
SuperMushroom8 is not online. SuperMushroom8
Joined: 26 Feb 2010
Total Posts: 15520
09 Mar 2014 09:20 AM
@cool

i dont think so..

i could be wrong
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:20 AM
warspyking did it right.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:22 AM
I did? Yay lol, I took a guess...
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:24 AM
Wait, whyd u make the Size a string value? Isnt it a number value?
Report Abuse
coolkidlaser is not online. coolkidlaser
Joined: 08 Feb 2013
Total Posts: 102
09 Mar 2014 09:25 AM
local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == (0,200),(0,55) then
BlueBox.Size = UDim2.new(0,55,0,55)
elseif BlueBox.Size == (0,55),(0,55) then
BlueBox.Size = UDim2.new(0,200),(0,55)
end
end)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:29 AM
I made it a string value because it has {}'s inside it!
Report Abuse
jojods1125 is not online. jojods1125
Joined: 27 Sep 2011
Total Posts: 11253
09 Mar 2014 09:34 AM
I've tried all of the ways you guys have suggested. Thanks for trying to help, but it's just not working.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:36 AM
Lemme do a quick wiki search...
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
09 Mar 2014 09:38 AM
Move out da way I got dis. I work with GUI's


local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == UDim2.new(0,200,0,55) then --This line is underlined in red. Why?
BlueBox.Size = UDim2.new(0,55,0,55)
else -- Why the unnecessary 'elseif'?
BlueBox.Size = UDim2.new(0,200,0,55)
end
end)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:44 AM
local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == (0, 200, 0, 55)then
BlueBox.Size = UDim2.new(0, 55, 0, 55)
elseif BlueBox.Size == (0, 55, 0, 55) then
BlueBox.Size = UDim2.new(0, 200, 0, 55)
end
end)
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
09 Mar 2014 09:44 AM
Tell me if it works. :3 If not I will try to fix it some more! :3
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
09 Mar 2014 09:45 AM
@War... I already posted the script fixed (btw the first line needs UDim2.new also! :3)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:45 AM
local BlueBox = script.Parent.Parent

script.Parent.MouseButton1Down:connect(function()

if BlueBox.Size == UDim2.new(0, 200, 0, 55)then
BlueBox.Size = UDim2.new(0, 55, 0, 55)
elseif BlueBox.Size == UDim2.new(0, 55, 0, 55) then
BlueBox.Size = UDim2.new(0, 200, 0, 55)
end
end)



Sorry made a simple mistake in last post...
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Mar 2014 09:46 AM
Oh sorry grag I never noticed
Report Abuse
jojods1125 is not online. jojods1125
Joined: 27 Sep 2011
Total Posts: 11253
09 Mar 2014 09:47 AM
@gragger

It worked, thanks!

And thanks to everyone else who tried to help. :)
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
09 Mar 2014 09:51 AM
No problem! Come back if you need more help! :3
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