Turbe$Z 52 Posted October 23, 2016 i tried create a window in freeroam, but doesn't working --------------------------- -- Teszt --------------------------- local GUIEditor = { button = {}, window = {}, label = {} } wnd.GUIEditor.window[1] = guiCreateWindow(541, 375, 360, 222, "Teszt", false) guiWindowSetSizable(wnd.GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(10, 182, 340, 30, "teszt", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(9, 26, 341, 156, "- Teszt", false, GUIEditor.window[1]) guiSetVisible( wnd.GUIEditor.window[1], false ) {'btn', id='gift', window=wnd.GUIEditor.window[1], width=250} Error: gui.lua:283: attempt to index local 'wnd' (a userdata value) what wrong? 1 Share this post Link to post
iPrestege 399 Posted October 23, 2016 (edited) wnd.GUIEditor.window[1] = wnd? wnd=? I think you are trying to create a button in the freeroam and and when the player press it show the gui? which is wnd.GUIEditor.window[1] ? Then no need to use wnd because it's nil and makes no sense remove it and just use it normally from what i'm seeing that is line 15 and 16 you are creating a button and label to a non-existing window. Just do it like this : { 'btn', id='gift', onclick=aCalledGiftFunction }, function aCalledGiftFunction ( ) if guiGetVisible( element guiElement ) ~= true then guiSetVisible( element guiElement, bool state ) showCursor( player thePlayer, bool show, [ bool toggleControls = true ] ) end end Edited October 23, 2016 by FaHaD 1 Share this post Link to post
Turbe$Z 52 Posted October 23, 2016 25 minutes ago, FaHaD said: wnd.GUIEditor.window[1] = wnd? wnd=? I think you are trying to create a button in the freeroam and and when the player press it show the gui? which is wnd.GUIEditor.window[1] ? Then no need to use wnd because it's nil and makes no sense remove it and just use it normally from what i'm seeing that is line 15 and 16 you are creating a button and label to a non-existing window. Just do it like this : { 'btn', id='gift', onclick=aCalledGiftFunction }, function aCalledGiftFunction ( ) guiSetVisible( element guiElement, bool state ) showCursor( bool show, [ bool toggleControls = true ] ) end Thanks man!:D 1 Share this post Link to post