Jump to content

Move Gate Problem


montel

Recommended Posts

Zombies don't open the door.How to do ?

local gate1 = createObject(980, 2493.5, 2350.6001, 12.6, 0, 0, 0) 
local marker = createMarker(2493.5, 2350.6001, 10, "cylinder", 6, 0, 0, 0, 0 ) 
  
function moveGate(hitPlayer, matchingDimension) 
            moveObject(gate1, 2000, 2493.5, 2350.6001, 17.6) 
        end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function moveBack() 
        moveObject(gate1, 2000, 2493.5, 2350.6001, 12.6) 
end 
addEventHandler( "onMarkerLeave", marker, moveBack ) 
  

Link to comment
when a player joins, you can use:
setElementData 

and, for the get you can use:

getElementData 

Why the hell,,, you want to set data to each player just to check if its a zombie or not? Zombies most likely have a skin, like the hobo one or something. If thats true in his situation, just let him check the skin and see if its a zombie or not. Way faster and a cleaner code. :3

Link to comment
when a player joins, you can use:
setElementData 

and, for the get you can use:

getElementData 

Why the hell,,, you want to set data to each player just to check if its a zombie or not? Zombies most likely have a skin, like the hobo one or something. If thats true in his situation, just let him check the skin and see if its a zombie or not. Way faster and a cleaner code. :3

Zombies can have any skin that there scripted for, and this code isn't really messy...

Link to comment

try

local gate1 = createObject(980, 2493.5, 2350.6001, 12.6, 0, 0, 0) 
local marker = createMarker(2493.5, 2350.6001, 10, "cylinder", 6, 0, 0, 0, 0 ) 
  
function moveGate(hitPlayer, matchingDimension) 
if getElementType ( hitPlayer ) == "player" then 
            moveObject(gate1, 2000, 2493.5, 2350.6001, 17.6) 
end 
        end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function moveBack(hitPlayer, matchingDimension) 
if getElementType ( hitPlayer ) == "player" then 
        moveObject(gate1, 2000, 2493.5, 2350.6001, 12.6) 
end 
end 
addEventHandler( "onMarkerLeave", marker, moveBack ) 

Link to comment
when a player joins, you can use:
setElementData 

and, for the get you can use:

getElementData 

Why the hell,,, you want to set data to each player just to check if its a zombie or not? Zombies most likely have a skin, like the hobo one or something. If thats true in his situation, just let him check the skin and see if its a zombie or not. Way faster and a cleaner code. :3

Zombies can have any skin that there scripted for, and this code isn't really messy...

Thats true, but most likely they have one skin. IF they dont, your idea is the best way to solve it. but if they do, its just a matter of getElementModel. :blob4:

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