Jump to content

[SOLVED] Gate Script


HeK

Recommended Posts

Hey guys, i'm having some problems with my gate script, first it's not only players that can open it, i have a zombie server and zombies can open it too.

Then, the other problem is the colShape, i don't know how to correctly create a colShape around the gate without messing it up.

gate = createObject ( 980, -303, 1507.5, 76.699996948242, 0, 0, 0 ) 
  
col = createColRectangle ( -303, 1507.5, 5.50, 10 ) 
  
function hit ( ) 
    moveObject ( gate, 1500, -314.29998779297, 1507.5, 76.699996948242 ) 
end 
  
addEventHandler ( "onColShapeHit", col, hit ) 
  
function leave ( ) 
    moveObject ( gate, 1500, -303, 1507.5, 76.699996948242 ) 
end 
addEventHandler ( "onColShapeLeave", col, leave ) 

Edited by Guest
Link to comment
gate = createObject(980, -303, 1507.5, 76.699996948242) 
col = createColCuboid(-310, 1502.5, 73, 14, 10,8) 
  
function hit(player) 
    if getElementType(player) == "player" then 
        moveObject(gate, 1500, -314.29998779297, 1507.5, 76.699996948242) 
    end 
end 
  
addEventHandler("onColShapeHit", col, hit) 
  
function leave(player) 
    if getElementType(player) == "player" then 
        moveObject(gate, 1500, -303, 1507.5, 76.699996948242) 
    end 
end 
addEventHandler("onColShapeLeave", col, leave) 

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