Jump to content

Gate Problem


Jade

Recommended Posts

local basekapi1 = createObject ( 980, 135.89999389648, 1941.6999511719, 21.10000038147, 0, 0, 0 ) 
local basekapi2 = createObject ( 980, 134.5, 1941.6999511719, 21.10000038147, 0, 0, 0 ) 
local marker1 = createMarker( 135.10000610352, 1941.3000488281, 18.39999961853, "cylinder", 10, 255, 255, 255, 0) 
  
function kapiac(pla) 
if getElementType ( pla ) == "player" then 
moveObject(basekapi1, 2000, 135.89999389648, 1941.6999511719, 26.60000038147, 0, 0, 0) 
moveObject(basekapi2, 2000, 134.5, 1941.6999511719, 26.60000038147, 0, 0, 0) 
end 
end 
addEventHandler( "onMarkerHit", marker1, kapiac ) 

Console:

WARNING: S.lua:6: Bad argument @ 'getElementType' [Expected element at argument 1]

trying the door, but I got this error?

Link to comment

I'm not entirely sure what causes the error, but you can use isElement.

Try this:

local basekapi1 = createObject ( 980, 135.89999389648, 1941.6999511719, 21.10000038147, 0, 0, 0 ) 
local basekapi2 = createObject ( 980, 134.5, 1941.6999511719, 21.10000038147, 0, 0, 0 ) 
local marker1 = createMarker( 135.10000610352, 1941.3000488281, 18.39999961853, "cylinder", 10, 255, 255, 255, 0) 
  
function kapiac(pla) 
if isElement(pla) and getElementType ( pla ) == "player" then 
moveObject(basekapi1, 2000, 135.89999389648, 1941.6999511719, 26.60000038147, 0, 0, 0) 
moveObject(basekapi2, 2000, 134.5, 1941.6999511719, 26.60000038147, 0, 0, 0) 
end 
end 
addEventHandler( "onMarkerHit", marker1, kapiac ) 

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