|
| 16 Aug 2013 09:32 PM |
server = _G.server = {} ektic = _G.server ektic.createGui = function(Parent, x, y, Sx, Sy, Name, Type) local gui = Instance.new(Type) gui.Parent = Parent gui.Name = Name if(gui.ClassName ~= ScreenGui) then gui.Position = UDim2.new(0,x,0,y) gui.Size = UDim2.new(0, Sx, 0, Sy,0) end end |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 16 Aug 2013 09:36 PM |
if(gui.ClassName ~= ScreenGui) then Errors because ScreenGui isn't in parentheses
if gui:IsA("ScreenGui") then
would work |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2013 09:39 PM |
Its printing out this error
19:37:56.336 - ektic.createGui(game.StarterGui:FindFirstChild("ScreenGui"):1: attempt to index global 'ektic' (a nil value) 19:37:56.338 - Script "ektic.createGui(game.StarterGui:FindFirstChild("ScreenGui")", Line 1 19:37:56.339 - stack end |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2013 09:40 PM |
UnAdmin meant, wasn't in QUOTATIONS, that is, it's not a String-literal.
if gui.ClassName ~= "ScreenGui" then
would also work (although :IsA is a nice thing to have).
Also, since it's ~=, it his correction should
if not gui:IsA("ScreenGui") then |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2013 09:45 PM |
| Yes I get that but it's printing out this error when I type into the command bar ektic.createGui(game.StarterGui.ScreenGui,50,50,100,100,"Player","Frame") |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2013 09:47 PM |
Because ektic isn't defined for the command bar.
Use
_G.server for that, since that's what you called it. |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2013 09:50 PM |
hmmm....that still doesn't work
_G.print = function(Text) print(Text) end _G.print("Hello")
doesn't even work
it still prints out 19:50:32.978 - _G.print("Hello"):1: attempt to call field 'print' (a nil value) 19:50:32.979 - Script "_G.print("Hello")", Line 1 19:50:32.981 - stack end |
|
|
| Report Abuse |
|
|