Jump to content

[HELP]Gates


JasperRieken

Recommended Posts

Posted

I made a script need it to open on marker hit but can't get it to work

This is the script

local Poortzombie = createObject (10841,1202.5509033203,-1389.4356689453,20.241466522217,0,0,179.99450683594) 
local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "Cylinder",20, 255, 0, 0, 0) 
  
function openZombieGate(hitplayer) 
moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,6.4914665222168) 
end 
addEventHandler("onMarkerHit",marker,openZombieGate) 
  
function closeZombieGate(hitplayer) 
moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,20.241466522217) 
end 
addEventHandler("onMarkerLeave",marker,closeZombieGate) 

If someone can help me that would be nice

Posted

is it client or server script?

if it's client-side — it won't work because of events.

if server — idk, tell us what happens (like marker is there but nothing happens) and what doesnt (like even no marker created).

Posted

have you added it correctly to meta.xml? does it even starts?

if it does — add some debug output to event handlers to see if event is triggered at all like:

local Poortzombie = createObject (10841,1202.5509033203,-1389.4356689453,20.241466522217,0,0,179.99450683594) 
local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder",20, 255, 0, 0, 0) 
  
function openZombieGate(hitplayer) 
outputChatBox("gate opens") 
moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,6.4914665222168) 
end 
addEventHandler("onMarkerHit",marker,openZombieGate) 
  
function closeZombieGate(hitplayer) 
outputChatBox("gate closes") 
moveObject (Poortzombie,1000,1202.5509033203,-1389.4356689453,20.241466522217) 
end 
addEventHandler("onMarkerLeave",marker,closeZombieGate) 

try to replace "Cylinder" with "cylinder" (honestly, i dont know if it's case-sensitive, just to be safe)

but first change your marker alpha (last 0) to something else than 0 (you wont see a marker with zero alpha) :P

local marker = createMarker(1201.7279052734,-1389.3259277344,13.16607093811, "cylinder", 20, 255, 0, 0, 128) 

Posted

next time use "/debugscript 3" command to see if your script gives any errors, if it has marker type name error, it'll obviously be there

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