of     2   
chevron_rightchevron_rightchevron_right

warspyking
#141832414Monday, July 28, 2014 12:50 PM GMT

But it did work in commandbar. Why? local Selected = game.Selection:Get() if not Selected[1]:IsA("GuiObject") then rint("Please make sure the selected object can be classified as a GuiObject") elseif #Selected ~= 1 then print("Please only select 1 gui item") elseif #Selected == 1 and Selected[1]:IsA("GuiObject") then --CODING end I need this to work... My previous layout was like this; local Selected = game.Selection:Get() if #Selected ~= 1 then print("Please only select 1 gui item") elseif not Selected[1]:IsA("GuiObject") then rint("Please make sure the selected object can be classified as a GuiObject") else --code end and it would ALWAYS print "Please only select 1 gui item" If you could fix EITHER of these, please do so ;D
warspyking
#141832469Monday, July 28, 2014 12:51 PM GMT

I forgot to mention the error for local Selected = game.Selection:Get() if not Selected[1]:IsA("GuiObject") then rint("Please make sure the selected object can be classified as a GuiObject") elseif #Selected ~= 1 then print("Please only select 1 gui item") elseif #Selected == 1 and Selected[1]:IsA("GuiObject") then --CODING end was attempt to index field '?' (a nil value)
warspyking
#141832526Monday, July 28, 2014 12:53 PM GMT

The line number is 104 which would be this line; if not Selected[1]:IsA("GuiObject") then
KingJacko
#141832528Monday, July 28, 2014 12:53 PM GMT

rint("Please make sure the selected object can be classified as a GuiObject") rint RINT
warspyking
#141832612Monday, July 28, 2014 12:55 PM GMT

I have no idea why it says rint on the post I made, but in studio it's print, so please ignore that lol.
warspyking
#141832831Monday, July 28, 2014 1:01 PM GMT

Here's my newest layout. Works just fine; local Selected = game.Selection:Get() if #Selected ~= 1 then print("Please only select 1 gui item") elseif not Selected[1]:IsA("GuiObject") then print("Please make sure the selected object can be classified as a GuiObject") elseif #Selected == 1 and Selected[1]:IsA("GuiObject") then EXCEPT FOR THE FACT THAT IT ALWAYS PRINTS "Please only select 1 gui item"
warspyking
#141833938Monday, July 28, 2014 1:28 PM GMT

HALP
warspyking
#141835002Monday, July 28, 2014 1:52 PM GMT

Anybody?
fret13103
#141835064Monday, July 28, 2014 1:54 PM GMT

You have more than one item selected.
warspyking
#141835351Monday, July 28, 2014 1:59 PM GMT

No I don't... It prints weather I do or I don't. Infact, it'll say #Selected ~= 1 and that #Selected == 1 It's not making any sense. It will go through if #Selected ~= 1 then and after it'll go thru the code where it says elseif #Selected == 1 and Selected[1]:IsA("GuiObject") then ?!?!?!
warspyking
#141839400Monday, July 28, 2014 3:10 PM GMT

Help. Me. BUMP!
MultiSettings
#141841222Monday, July 28, 2014 3:37 PM GMT

local SeIected = game.SeIection:Get() if #Selected ~= 1 then while true do print("Please only select 1 gui item") end elseif not Selected[1]:IsA("GuiObject") then print("Please make sure the selected object can be cIassified as a GuiObject") elseif #Selected == 1 and Selected[1]:IsA("GuiObject") then
warspyking
#141841859Monday, July 28, 2014 3:47 PM GMT

@Multi Stop trolling -_-
warspyking
#141851388Monday, July 28, 2014 5:39 PM GMT

Bump :D
warspyking
#141852270Monday, July 28, 2014 5:49 PM GMT

Bump :)
warspyking
#141853451Monday, July 28, 2014 6:05 PM GMT

Bump :|
warspyking
#141853825Monday, July 28, 2014 6:10 PM GMT

Bump :(
warspyking
#141869406Monday, July 28, 2014 8:38 PM GMT

Bump D:
cntkillme
#141869739Monday, July 28, 2014 8:41 PM GMT

Your error is that if nothing is selected, you can't call IsA on a nil value. if #selected > 0 then --etc end
warspyking
#141871620Monday, July 28, 2014 8:54 PM GMT

If nothing is selected it shouldn't. Call IsA on nil, it should print Please only select 1 gui item, because #Selected ~= 1 should return true. For some reason #Selected ~= 1 returns true, (it still returns true even when it's false) however it continues to run through the elseif statements?
cntkillme
#141871893Monday, July 28, 2014 8:56 PM GMT

That still allows it to be 0.
warspyking
#141872848Monday, July 28, 2014 9:05 PM GMT

Yes if #Selected ~= 1 then --If it's less or more than 1 (includes 0) print("Please only select 1 gui item") --Print elseif not Selected[1]:IsA("GuiObject") then --This should only run if it IS 1 rint("Please make sure the selected object can be classified as a GuiObject") --Print, this'll print if they've got 1 object selected, and it is not a GuiObject --Rest of my code cause this is unnesecary.
cntkillme
#141872982Monday, July 28, 2014 9:06 PM GMT

I mean the else will run if it is 0 too
cntkillme
#141873596Monday, July 28, 2014 9:12 PM GMT

wait nevermind. Which code are you using? Top or bottom
warspyking
#141873738Monday, July 28, 2014 9:13 PM GMT

You're not getting this... If the initial if statement returns true none of the others should execute.

    of     2   
chevron_rightchevron_rightchevron_right