Jump to content

Help needed LUA


jwalks

Recommended Posts

Editor      = {} 
Gate        = {} 
Gate2       = {} 
Precision   = {} 
status      = {} 
coll        = {} 
coll2        = {} 
coll3        = {} 
coll4        = {} 
  
 -- this script mod is (no longer) PRIVATE 
 -- - Deject3d 
  
function startBuilding(playerSource, commandName, objectid) 
    if not objectid then 
        outputChatBox("usage: /addgate objectid teamname", playerSource) 
        return false 
    end 
         
    local team = getTeamName(getPlayerTeam" class="kw2">getPlayerTeam(playerSource)) 
    if team then team = getTeamName(team) 
        else team = "" end 
    end 
    for i = 1,20 do 
        if Editor[i] == playerSource then 
            destroyElement(Gate[i]) 
            Gate[i] = null 
            Editor[i] = null 
            Precision[i] = null 
        end 
        if Editor[i] == null then 
            Editor[i] = playerSource -- set Editor[i] to who made the object 
  
                --creating object -v 
            local x,y,z = getElementPosition(playerSource) 
            object = createObject ( objectid, x + 3,y + 3,z) 
            interior = getElementInterior ( playerSource ) 
            setElementInterior(object,interior) 
                --created object -^ 
  
            Gate[i] = object -- added object identifier to the array, corresponds to who created it 
            Precision[i] = .5   -- default precision 
  
            bindKey(playerSource, "i",        "down", moveIt) 
            bindKey(playerSource, "j",        "down", moveIt) 
            bindKey(playerSource, "k",        "down", moveIt) 
            bindKey(playerSource, "l",        "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_up",   "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_down", "down", moveIt) 
            bindKey(playerSource, "pgup",         "down", moveIt) 
            bindKey(playerSource, "pgdn",         "down", moveIt) 
  
            bindKey(playerSource, "u",        "down", moveIt) 
            bindKey(playerSource, "o",        "down", moveIt) 
  
            bindKey(playerSource, "[",        "down", moveIt) 
            bindKey(playerSource, "]",        "down", moveIt) 
  
            bindKey(playerSource, "enter",        "down", nextPosition ,objectid, team) 
            bindKey(playerSource, "delete",       "down", removeIt, playerSource) 
  
            break -- done adding our object and who created it to the arrays... stop the loop 
        end 
    end 
  
end 
  

i get this error message

[18:57:32] SCRIPT ERROR: gatemaker\server.lua:66: '' expected near 'end'

[18:57:32] WARNING: Loading script failed: gatemaker\server.lua:66: '' expe

cted near 'end'

Link to comment
Editor      = {} 
Gate        = {} 
Gate2       = {} 
Precision   = {} 
status      = {} 
coll        = {} 
coll2        = {} 
coll3        = {} 
coll4        = {} 
  
 -- this script mod is (no longer) PRIVATE 
 -- - Deject3d 
  
function startBuilding(playerSource, commandName, objectid) 
    if not objectid then 
        outputChatBox("usage: /addgate objectid teamname", playerSource) 
        return false 
    end 
        
    local team = getTeamName(getPlayerTeam" class="kw2">getPlayerTeam(playerSource)) 
    if team then team = getTeamName(team) 
        else team = "" end 
    end 
    for i = 1,20 do 
        if Editor[i] == playerSource then 
            destroyElement(Gate[i]) 
            Gate[i] = null 
            Editor[i] = null 
            Precision[i] = null 
        end 
        if Editor[i] == null then 
            Editor[i] = playerSource -- set Editor[i] to who made the object 
  
                --creating object -v 
            local x,y,z = getElementPosition(playerSource) 
            object = createObject ( objectid, x + 3,y + 3,z) 
            interior = getElementInterior ( playerSource ) 
            setElementInterior(object,interior) 
                --created object -^ 
  
            Gate[i] = object -- added object identifier to the array, corresponds to who created it 
            Precision[i] = .5   -- default precision 
  
            bindKey(playerSource, "i",        "down", moveIt) 
            bindKey(playerSource, "j",        "down", moveIt) 
            bindKey(playerSource, "k",        "down", moveIt) 
            bindKey(playerSource, "l",        "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_up",   "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_down", "down", moveIt) 
            bindKey(playerSource, "pgup",         "down", moveIt) 
            bindKey(playerSource, "pgdn",         "down", moveIt) 
  
            bindKey(playerSource, "u",        "down", moveIt) 
            bindKey(playerSource, "o",        "down", moveIt) 
  
            bindKey(playerSource, "[",        "down", moveIt) 
            bindKey(playerSource, "]",        "down", moveIt) 
  
            bindKey(playerSource, "enter",        "down", nextPosition ,objectid, team) 
            bindKey(playerSource, "delete",       "down", removeIt, playerSource) 
  
            break -- done adding our object and who created it to the arrays... stop the loop 
        end 
end 

Link to comment

Editor      = {} 
Gate        = {} 
Gate2       = {} 
Precision   = {} 
status      = {} 
coll        = {} 
coll2        = {} 
coll3        = {} 
coll4        = {} 
  
 -- this script mod is (no longer) PRIVATE 
 -- - Deject3d 
  
function startBuilding(playerSource, commandName, objectid) 
    if not objectid then 
        outputChatBox("usage: /addgate objectid teamname", playerSource) 
        return false 
    end 
        
    local team = getTeamName(getPlayerTeam(playerSource)) 
    if team then team = getTeamName(team) 
        else team = "" end 
    end 
    for i = 1,20 do 
        if Editor[i] == playerSource then 
            destroyElement(Gate[i]) 
            Gate[i] = null 
            Editor[i] = null 
            Precision[i] = null 
        end 
        if Editor[i] == null then 
            Editor[i] = playerSource -- set Editor[i] to who made the object 
  
                --creating object -v 
            local x,y,z = getElementPosition(playerSource) 
            object = createObject ( objectid, x + 3,y + 3,z) 
            interior = getElementInterior ( playerSource ) 
            setElementInterior(object,interior) 
                --created object -^ 
  
            Gate[i] = object -- added object identifier to the array, corresponds to who created it 
            Precision[i] = .5   -- default precision 
  
            bindKey(playerSource, "i",        "down", moveIt) 
            bindKey(playerSource, "j",        "down", moveIt) 
            bindKey(playerSource, "k",        "down", moveIt) 
            bindKey(playerSource, "l",        "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_up",   "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_down", "down", moveIt) 
            bindKey(playerSource, "pgup",         "down", moveIt) 
            bindKey(playerSource, "pgdn",         "down", moveIt) 
  
            bindKey(playerSource, "u",        "down", moveIt) 
            bindKey(playerSource, "o",        "down", moveIt) 
  
            bindKey(playerSource, "[",        "down", moveIt) 
            bindKey(playerSource, "]",        "down", moveIt) 
  
            bindKey(playerSource, "enter",        "down", nextPosition ,objectid, team) 
            bindKey(playerSource, "delete",       "down", removeIt, playerSource) 
  
            break -- done adding our object and who created it to the arrays... stop the loop 
        end 
end 

P.S: I'm not using LUA tags because it would do the same ;)

Link to comment
Editor      = {} 
Gate        = {} 
Gate2       = {} 
Precision   = {} 
status      = {} 
coll        = {} 
coll2        = {} 
coll3        = {} 
coll4        = {} 
  
 -- this script mod is (no longer) PRIVATE 
 -- - Deject3d 
  
function startBuilding(playerSource, commandName, objectid) 
    if not objectid then 
        outputChatBox("usage: /addgate objectid teamname", playerSource) 
        return false 
    end 
         
    local team = getTeamName(getPlayerTeam(playerSource)) 
    if team then team = getTeamName(team) 
        else team = "" end 
    end 
    for i = 1,20 do 
        if Editor[i] == playerSource then 
            destroyElement(Gate[i]) 
            Gate[i] = null 
            Editor[i] = null 
            Precision[i] = null 
        end 
        if Editor[i] == null then 
            Editor[i] = playerSource -- set Editor[i] to who made the object 
  
                --creating object -v 
            local x,y,z = getElementPosition(playerSource) 
            object = createObject ( objectid, x + 3,y + 3,z) 
            interior = getElementInterior ( playerSource ) 
            setElementInterior(object,interior) 
                --created object -^ 
  
            Gate[i] = object -- added object identifier to the array, corresponds to who created it 
            Precision[i] = .5   -- default precision 
  
            bindKey(playerSource, "i",        "down", moveIt) 
            bindKey(playerSource, "j",        "down", moveIt) 
            bindKey(playerSource, "k",        "down", moveIt) 
            bindKey(playerSource, "l",        "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_up",   "down", moveIt) 
            bindKey(playerSource, "mouse_wheel_down", "down", moveIt) 
            bindKey(playerSource, "pgup",         "down", moveIt) 
            bindKey(playerSource, "pgdn",         "down", moveIt) 
  
            bindKey(playerSource, "u",        "down", moveIt) 
            bindKey(playerSource, "o",        "down", moveIt) 
  
            bindKey(playerSource, "[",        "down", moveIt) 
            bindKey(playerSource, "]",        "down", moveIt) 
  
            bindKey(playerSource, "enter",        "down", nextPosition ,objectid, team) 
            bindKey(playerSource, "delete",       "down", removeIt, playerSource) 
  
            break -- done adding our object and who created it to the arrays... stop the loop 
        end 
    end 
  
end 
  
function nextPosition(playerSource, key, keyState, objectid, team) 

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