Jump to content

moving object


Fox261098

Recommended Posts

local x,y,z = 2096.3, 1721, 12.7 
local easing = "OutBounce" 
local time = 2000 
local gate = createObject(980, x,y,z, 0, 0, 63) 
local marker = createMarker(x,y,z, "cylinder", 12, 0, 0, 0, 0) 
  
function moveGate(hitPlayer, matchingDimension) 
        moveObject(gate, time, x+4.9, y+9.6, z, 0, 0, 0, easing) 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function moveBack() 
    moveObject(gate, time, x, y, z, 0, 0, 0, easing) 
end 
addEventHandler("onMarkerLeave", marker, moveBack) 

This is a example of a moving gate, when the player hits the marker. the object moves.

This is the main thing you can use to move a object. moveObject.

Good luck.

Link to comment
local gate = createObject(980, x,y,z,rx,ry,rz) 
local marker = createMarker(x,y,z, "cylinder", 12, 0, 0, 0, 0) 
  
function moveGate() 
        moveObject(gate, 3000,x,y,z) 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
   local gang = getElementData(player, "gang") or false; 
    if (gang ~= false and gang == "The Gang Name") then 
         
    end 
end) 
  
function moveBack() 
    moveObject(gate, 3000,x, y, z,) 
end 
addEventHandler("onMarkerLeave", marker, moveBack) 
  
  

this is for dayz will it work too=

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