Jump to content

[Help]Run Script when player spawn


Recommended Posts

Hi guys, i have worked with GUI editor alittle bit and i dont know how to make the script work as soon as the local player spawn

and i what that after i picked a car model and click the butten ill be in the car and locked inside it ill do it my self but im pritty new the Lua Script and having hard time learning it, well tnx :D

  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {}, 
    combobox = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Club") 
        GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1])     
    end 
) 
  

Link to comment
Hi guys, i have worked with GUI editor alittle bit and i dont know how to make the script work as soon as the local player spawn

and i what that after i picked a car model and click the butten ill be in the car and locked inside it ill do it my self but im pritty new the Lua Script and having hard time learning it, well tnx :D

  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {}, 
    combobox = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Club") 
        GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1])     
    end 
) 
  

Mate, Do you have a meta.xml? other thing you need script.lua and put them in the meta.xml

other thing you can add a (addCommandHandler Like this

[code=text]  
GUIEditor = { 
    button = {}, 
    window = {}, 
    label = {}, 
    combobox = {} 
} 
    function Start() 
        GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[1], "clear-normal") 
        GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") 
        guiComboBoxAddItem(GUIEditor.combobox[1], "Club") 
        GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1])     
    end 
   addCommandHandler ("startscript ", Start) 
  --- It means when you do in the server /startscript it starts. 
  
--- And for that use: warpPedIntoVehicle ( ped thePed, vehicle theVehicle, [ int seat=0 ] ) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...