Jump to content

Help me with this please :D


iFoReX

Recommended Posts

That's because Draken forgot to check if the hitElement was the localPlayer.

GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Edit = {} 
  
GUIEditor_Window[1] = guiCreateWindow(195,167,372,244,"Gui Sistema De Mover Objetos",false) 
GUIEditor_Button[1] = guiCreateButton(61,123,231,49,"Mover",false,GUIEditor_Window[1]) 
GUIEditor_Edit[1] = guiCreateEdit(53,63,256,44,"Porfavor Pon la Contraseña Correcta----",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(60,180,233,52,"Cancelar",false,GUIEditor_Window[1]) 
guiSetVisible ( GUIEditor_Window[1], false ) 
  
local objeto = createObject ( 2669, 1090.67834, -2704.56226, 8.48407, 0, 0, 270) 
local Col = createColCuboid ( 1088, -2705.56226, 7.5, 5, 2, 4 ) 
  
addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == GUIEditor_Button[1] ) then 
            local text = guiGetText ( GUIEditor_Edit[1] ) 
            if ( text == 'yourPassword' ) then 
                moveObject ( objeto, 5000, 1090.67834, -2704.56226, 18, 0, 0, 0 ) 
                setTimer ( moveObject, 10000, 1, objeto, 5000, 1090.67834, -2704.56226, 9 ) 
            else 
                outputChatBox ( 'Incorrect password!' ); 
            end 
        end 
    end 
) 
  
local objeto2 = createObject ( 2669, 1111.05212, -3085.17236, 3.55537, 0, 0, 270) 
local Col2 = createColCuboid ( 1088, 1111.05212, -3085.17236, 3.55537 ) 
  
addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == GUIEditor_Button[1] ) then 
            local text = guiGetText ( GUIEditor_Edit[1] ) 
            if ( text == 'yourPassword' ) then 
                moveObject ( objeto2, 5000, 1111.05212, -3085.17236, 3.55537 ) 
                setTimer ( moveObject, 10000, 1, objeto2, 5000, 1111.05212, -3085.17236, 3.55537 ) 
            else 
                outputChatBox ( 'Incorrect password!' ); 
            end 
        end 
    end 
) 
  
addEventHandler ( 'onClientColShapeHit', root, 
    function ( hitElement ) 
        if ( source == Col or source == Col2 and hitElement == localPlayer ) then -- Here. 
            guiSetVisible ( GUIEditor_Window[1], true ) 
            showCursor ( true ) 
        end 
    end 
) 

Link to comment

What is bad ?

  
    function abrir() 
  
                local puerta = createObject(ID, x, y, z, 0, 0, 0) 
  
                local ID = 971 
            local x = 96.55167 
            local y = 1920.39172 
            local z = 18.14190 
  
            -- move the gate 
            moveObject(puerta,1500,x2,y2,z2) 
  
            -- get the original position 
            local  x2 = 96.55167 
            local  y2 = 1920.39172 
            local  z2 = 21 
  
            -- set a timer to close the gate in 5 seconds 
            setTimer(moveObject,5000,1,puerta,1500,x,y,z) 
        end 
    end 
) 
  
addCommandHandler("abrir51", abrir) 

Dont appear my Object :/

Link to comment
function abrir ( ) 
    local ID = 971 
    local x = 96.55167 
    local y = 1920.39172 
    local z = 18.14190 
    local puerta = createObject ( ID, x, y, z, 0, 0, 0 ) 
  
    -- move the gate 
    local  x2 = 96.55167 
    local  y2 = 1920.39172 
    local  z2 = 21 
    moveObject ( puerta, 1500, x2, y2, z2 ) 
    -- set a timer to close the gate in 5 seconds 
    setTimer ( moveObject, 5000, 1, puerta, 1500, x, y, z ) 
end  
addCommandHandler ( "abrir51", abrir ) 

Your errors:

1: You had an extra parentheses.

2: You had an extra 'end'.

3: Your variables we're defined AFTER you use them.

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