Jump to content

Select skin2[HELP]


Recommended Posts

      local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[1], true) 
                showCursor(true) 
            end 
        end) 
          
          
        function CreateGUIWindow() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Image = {} 
        GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
        GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
        GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
        GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
        GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
        guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
        guiSetVisible(GUIEditor_Window[1], false) 
          
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], move, false) 
        end 
            addEventHandler("onClientResourceStart", root, CreateGUIWindow) 
            addEventHandler('onClientGUIClick', root, 
        function () 
        if ( source == GUIEditor_Button[2] ) then 
            guiSetVisible(GUIEditor_Window[1],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
            elseif ( source == GUIEditor_Button[4] ) then 
            guiSetVisible(GUIEditor_Window[2],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
        end 
        end) 
              
        function take() 
            if( getPlayerMoney( localPlayer ) >= 100000 ) then 
                takePlayerMoney (100000) 
                outputChatBox("#00ff00You bought a ticket you can go to the rocket now have a nice trip.",255,255,255,true) 
                guiSetVisible(GUIEditor_Window[1],false) 
                guiSetInputEnabled(false) 
                showCursor(false) 
            else 
                outputChatBox("#FFFF00Sorry, you don't have enough money",255,255,255,true) 
            end 
        end 
          
        function move() 
           if (point == 1) then 
            moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2)     
           elseif( point == 2) then 
            moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1) 
            
          end 
        end 
             
      local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[2], true) 
                showCursor(true) 
            end 
        end) 
         
        function CreateFarm() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Grid = {} 
        GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) 
        guiSetAlpha(GUIEditor_Window[2],1) 
        guiWindowSetSizable(GUIEditor_Window[2],false) 
        GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) 
        GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) 
        GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) 
        guiMemoSetReadOnly(GUIEditor_Memo[2],true) 
        guiSetVisible(GUIEditor_Window[2], false) 
         
        addEventHandler("onClientGUIClick", GUIEditor_Button[3], skins, false) 
  
        local skins = -- Create a table with our skin names and their ID's. 
        { 
            { "Farmer", 158 }, 
            { "Farmer Redneck", 159 }, 
            { "Farmer Girl", 157 } 
        } 
        GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[2]) 
        guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) 
        for index, skin in ipairs ( skins ) do 
            local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
            guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) 
            guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) 
        end 
      end   

When i hit this marker

local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 

it says WARNING: Marker.lua:66: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil]

I tried to fix it about 2 or 4 hours.

sorry guys i'm really need of help this problem always exists when i create a new marker and make it as hit as window

Link to comment

try it now

local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[1], true) 
                showCursor(true) 
            end 
        end) 
         
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Image = {}   
        function CreateGUIWindow() 
        GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
        GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
        GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
        GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
        GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
        guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
        guiSetVisible(GUIEditor_Window[1], false) 
          
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], move, false) 
        end 
            addEventHandler("onClientResourceStart", root, CreateGUIWindow) 
            addEventHandler('onClientGUIClick', root, 
        function () 
        if ( source == GUIEditor_Button[2] ) then 
            guiSetVisible(GUIEditor_Window[1],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
            elseif ( source == GUIEditor_Button[4] ) then 
            guiSetVisible(GUIEditor_Window[2],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
        end 
        end) 
              
        function take() 
            if( getPlayerMoney( localPlayer ) >= 100000 ) then 
                takePlayerMoney (100000) 
                outputChatBox("#00ff00You bought a ticket you can go to the rocket now have a nice trip.",255,255,255,true) 
                guiSetVisible(GUIEditor_Window[1],false) 
                guiSetInputEnabled(false) 
                showCursor(false) 
            else 
                outputChatBox("#FFFF00Sorry, you don't have enough money",255,255,255,true) 
            end 
        end 
          
        function move() 
           if (point == 1) then 
            moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2)     
           elseif( point == 2) then 
            moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1) 
            
          end 
        end 
             
      local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[2], true) 
                showCursor(true) 
            end 
        end) 
         
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Grid = {} 
        function CreateFarm() 
        GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) 
        guiSetAlpha(GUIEditor_Window[2],1) 
        guiWindowSetSizable(GUIEditor_Window[2],false) 
        GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) 
        GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) 
        GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) 
        guiMemoSetReadOnly(GUIEditor_Memo[2],true) 
        guiSetVisible(GUIEditor_Window[2], false) 
         
        addEventHandler("onClientGUIClick", GUIEditor_Button[3], skins, false) 
  
        local skins = -- Create a table with our skin names and their ID's. 
        { 
            { "Farmer", 158 }, 
            { "Farmer Redneck", 159 }, 
            { "Farmer Girl", 157 } 
        } 
        GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[2]) 
        guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) 
        for index, skin in ipairs ( skins ) do 
            local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
            guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) 
            guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) 
        end 
      end   

Link to comment
try it now
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[1], true) 
                showCursor(true) 
            end 
        end) 
         
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Image = {}   
        function CreateGUIWindow() 
        GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
        GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
        GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
        GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
        GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
        guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
        guiSetVisible(GUIEditor_Window[1], false) 
          
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
            addEventHandler("onClientGUIClick", GUIEditor_Button[1], move, false) 
        end 
            addEventHandler("onClientResourceStart", root, CreateGUIWindow) 
            addEventHandler('onClientGUIClick', root, 
        function () 
        if ( source == GUIEditor_Button[2] ) then 
            guiSetVisible(GUIEditor_Window[1],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
            elseif ( source == GUIEditor_Button[4] ) then 
            guiSetVisible(GUIEditor_Window[2],false) 
            guiSetInputEnabled(false) 
            showCursor(false) 
        end 
        end) 
              
        function take() 
            if( getPlayerMoney( localPlayer ) >= 100000 ) then 
                takePlayerMoney (100000) 
                outputChatBox("#00ff00You bought a ticket you can go to the rocket now have a nice trip.",255,255,255,true) 
                guiSetVisible(GUIEditor_Window[1],false) 
                guiSetInputEnabled(false) 
                showCursor(false) 
            else 
                outputChatBox("#FFFF00Sorry, you don't have enough money",255,255,255,true) 
            end 
        end 
          
        function move() 
           if (point == 1) then 
            moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2)     
           elseif( point == 2) then 
            moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0) 
            setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1) 
            
          end 
        end 
             
      local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 
        addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
            if (hitPlayer == localPlayer) then 
                guiSetVisible(GUIEditor_Window[2], true) 
                showCursor(true) 
            end 
        end) 
         
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Grid = {} 
        function CreateFarm() 
        GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) 
        guiSetAlpha(GUIEditor_Window[2],1) 
        guiWindowSetSizable(GUIEditor_Window[2],false) 
        GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) 
        GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) 
        GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) 
        guiMemoSetReadOnly(GUIEditor_Memo[2],true) 
        guiSetVisible(GUIEditor_Window[2], false) 
         
        addEventHandler("onClientGUIClick", GUIEditor_Button[3], skins, false) 
  
        local skins = -- Create a table with our skin names and their ID's. 
        { 
            { "Farmer", 158 }, 
            { "Farmer Redneck", 159 }, 
            { "Farmer Girl", 157 } 
        } 
        GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[2]) 
        guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.2) 
        for index, skin in ipairs ( skins ) do 
            local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
            guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) 
            guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) 
        end 
      end   

  
WARNING: Marker.lua:65: Bad argument @ 'guiSetVisible' [Expected gui-element at argument 1, got nil] 
  

It's 65 now

Link to comment

Yes, there's many mistakes in your code. So, I'll give you a hint: create a function to create all GUI elements (windows, buttons, labels, etc) and set this function to "onClientResourceStart" event. And remember: in this function, set all elements to not visible (guiSetVisible(element, false)).

So, when the player hits a marker, just use guiSetVisible(element, true) to set the elements visible.

Link to comment

You didn't define "point","objectairportgate1","omgMoveobjectairportgate1" and please organize your script (use Notepad++),

Anyways, here:

local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
addEventHandler("onClientResourceStart", resourceRoot, CreateGUIWindow) 
function CreateGUIWindow() 
    GUIEditor_Window = {} 
    GUIEditor_Button = {} 
    GUIEditor_Memo = {} 
    GUIEditor_Image = {} 
    GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
    GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
    GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
    GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
    guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
    guiSetVisible(GUIEditor_Window[1], false) 
     
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], move, false) 
end 
  
function take() 
    if( getPlayerMoney( localPlayer ) >= 100000 ) then 
        takePlayerMoney (100000) 
        outputChatBox("#00ff00You bought a ticket you can go to the rocket now have a nice trip.",255,255,255,true) 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    else 
        outputChatBox("#FFFF00Sorry, you don't have enough money",255,255,255,true) 
    end 
end 
          
function move() 
    if (point == 1) then 
        moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
        setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2)     
    elseif( point == 2) then 
        moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0) 
        setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1)   
    end 
end 
        
     
     
local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[2], true) 
        showCursor(true) 
    end 
end) 
  
function CreateFarm() 
    GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) 
    guiSetAlpha(GUIEditor_Window[2],1) 
    guiWindowSetSizable(GUIEditor_Window[2],false) 
    GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) 
    GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) 
    GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) 
    guiMemoSetReadOnly(GUIEditor_Memo[2],true) 
    guiSetVisible(GUIEditor_Window[2], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[3], skins, false) 
        local skins = -- Create a table with our skin names and their ID's. 
        { 
            { "Farmer", 158 }, 
            { "Farmer Redneck", 159 }, 
            { "Farmer Girl", 157 } 
        } 
    GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[2]) 
    guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.4) 
    for index, skin in ipairs ( skins ) do 
        local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) 
        guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) 
    end 
end   
  
addEventHandler('onClientGUIClick', guiRoot,function() 
    if ( source == GUIEditor_Button[2] ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    elseif ( source == GUIEditor_Button[4] ) then 
        guiSetVisible(GUIEditor_Window[2],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    end 
end,true) 

Link to comment
You didn't define "point","objectairportgate1","omgMoveobjectairportgate1" and please organize your script (use Notepad++),

Anyways, here:

local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
addEventHandler("onClientResourceStart", resourceRoot, CreateGUIWindow) 
function CreateGUIWindow() 
    GUIEditor_Window = {} 
    GUIEditor_Button = {} 
    GUIEditor_Memo = {} 
    GUIEditor_Image = {} 
    GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
    GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
    GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
    GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
    guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
    guiSetVisible(GUIEditor_Window[1], false) 
     
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], move, false) 
end 
  
function take() 
    if( getPlayerMoney( localPlayer ) >= 100000 ) then 
        takePlayerMoney (100000) 
        outputChatBox("#00ff00You bought a ticket you can go to the rocket now have a nice trip.",255,255,255,true) 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    else 
        outputChatBox("#FFFF00Sorry, you don't have enough money",255,255,255,true) 
    end 
end 
          
function move() 
    if (point == 1) then 
        moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
        setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2)     
    elseif( point == 2) then 
        moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0) 
        setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1)   
    end 
end 
        
     
     
local Marker = createMarker ( -28.599609375, 163.8994140625, 1.3999999761581, "cylinder", 1.60000002, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[2], true) 
        showCursor(true) 
    end 
end) 
  
function CreateFarm() 
    GUIEditor_Window[2] = guiCreateWindow(18,307,367,431,"",false) 
    guiSetAlpha(GUIEditor_Window[2],1) 
    guiWindowSetSizable(GUIEditor_Window[2],false) 
    GUIEditor_Button[3] = guiCreateButton(22,377,88,42,"Work",false,GUIEditor_Window[2]) 
    GUIEditor_Button[4] = guiCreateButton(246,383,86,39,"Exit",false,GUIEditor_Window[2]) 
    GUIEditor_Memo[2] = guiCreateMemo(16,32,339,216,"=====|Farm Job|=====\nWelcome to the farm job\nthe farm job is about farm stuff \nso when you start go get the parcel of Seed\nand it's located on your map then go\nto the farm and drop the seed onto every arrow when you done wait 5 sec to get the plant\ngrown and go get the combine harvester and collect your crops when you done collecting \nhit the checkpoints and you get \n1200$\n\n=====|Farm Job|=====",false,GUIEditor_Window[2]) 
    guiMemoSetReadOnly(GUIEditor_Memo[2],true) 
    guiSetVisible(GUIEditor_Window[2], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[3], skins, false) 
        local skins = -- Create a table with our skin names and their ID's. 
        { 
            { "Farmer", 158 }, 
            { "Farmer Redneck", 159 }, 
            { "Farmer Girl", 157 } 
        } 
    GUIEditor_Grid[1] = guiCreateGridList(12,260,346,79,false,GUIEditor_Window[2]) 
    guiGridListAddColumn(GUIEditor_Grid[1],"Select your skin",0.4) 
    for index, skin in ipairs ( skins ) do 
        local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
        guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, skin [ 1 ], false, false ) 
        guiGridListSetItemData ( GUIEditor_Grid[1], row, 1, skin [ 2 ] ) 
    end 
end   
  
addEventHandler('onClientGUIClick', guiRoot,function() 
    if ( source == GUIEditor_Button[2] ) then 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    elseif ( source == GUIEditor_Button[4] ) then 
        guiSetVisible(GUIEditor_Window[2],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    end 
end,true) 

I'm already use notepad ++ and unfortunately the gate still don't move

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...