Jump to content

i made a hex gata.lua can someone help me


jdmark

Recommended Posts

Posted
object = createObject (980, 2813.330078125, -1468.1806640625, 16.254442214966) 
marker = createMarker(2813.330078125, -1468.1806640625, 16.254442214966, "cylinder", 2, 100, 0, 0, 100) 
function gate(player) 
  local data = getElementData(player,"job") 
  if (data=="hex") then  
  moveObject(object, 500, 2813.330078125, -1468.1806640625, 16.254442214966) 
   else 
   outputChatBox('Sorry, you can't enter the impound.",player,255,0,0) 
end 
  
addEventHandler("onmarkerhit",gateo) 
  
function gatec(player) 
moveObject(object,2813.330078125, -1468.1806640625, 16.254442214966) 
end 
addEventHandler("onmakerleave",gatec) 
end 
 

this is the lua script i made can someone check it please

Posted
object = createObject (980, 2813.330078125, -1468.1806640625, 16.254442214966) 
marker = createMarker(2813.330078125, -1468.1806640625, 16.254442214966, "cylinder", 2, 100, 0, 0, 100) 
  
function gate(player) 
    local data = getElementData(player,"job") 
    if (data=="hex") then 
        moveObject(object, 500, 2813.330078125, -1468.1806640625, 16.254442214966) 
    else 
        outputChatBox("Sorry, you can't enter the impound.",player,255,0,0) -- used both ' and " which broke the function 
    end 
end 
addEventHandler("onMarkerHit", marker, gate) -- Case sensitive!  
      
function gatec(player) 
    moveObject(object,2813.330078125, -1468.1806640625, 16.254442214966) 
end 
addEventHandler("onMarkerLeave", marker, gatec) -- case sensitive as well 
   

 

Posted

And how do you get the "faction" name? With getElementData?

If so, you've already done it good in first function, apply the same at second function when closing gates.

 

  • Moderators
Posted

I think that will be type()

if type(value) =="table" then -- not sure if table is also a type, but yes I think it is. 
  
elseif type(value) =="string" then 
  
elseif type(value) =="number" then 
  
end 

But hex becomes a number....... or you should first convert it to a string.

tostring() 
tonumber() 
  

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

What he meant by hex is a name of gang, not a hex code.

Btw. he contacted me via PM where I explained him things he needed.

 

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