Jump to content

Ворота которые открываются по скину)


Recommended Posts

Всем привет ребят вот создал скрипт ворот с открыванием по скину ворота создаются но по скину не открываются помогите пожалуйста вот скрипт который я создал:

local gate = createObject(8210,2497.8999023438,2769.3999023438,12.89999961853, 0, 0, 270.25 ) 
  
function openagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will open only if the player is in the male staff skin 
        moveObject ( gate, 6000, 2497.8999023438, 2769.3999023438, 4.0999999046326 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. 
        end 
end 
addEventHandler( "onColShapeHit", gatecol, openagates ) 
  
function closeagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will close only if the player is in the male staff skin 
       moveObject (gate1, 6000, 2497.8999023438, 2769.3999023438, 12.89999961853) --The speed in which 7000 is slow and 1000 is fast to open, Co-Ordinates for the gate to close. 
        end 
end 
  

Edited by Guest
Link to comment
Всем привет ребят вот создал скрипт ворот с открыванием по скину ворота создаются но по скину не открываются помогите пожалуйста вот скрипт который я создал:
local gate = createObject(8210,2497.8999023438,2769.3999023438,12.89999961853, 0, 0, 270.25 ) 
  
function openagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will open only if the player is in the male staff skin 
        moveObject ( gate, 6000, 2497.8999023438, 2769.3999023438, 4.0999999046326 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. 
        end 
end 
addEventHandler( "onColShapeHit", gatecol, openagates ) 
  
function closeagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will close only if the player is in the male staff skin 
       moveObject (gate1, 6000, 2497.8999023438, 2769.3999023438, 12.89999961853) --The speed in which 7000 is slow and 1000 is fast to open, Co-Ordinates for the gate to close. 
        end 
end 
  

У тебя нету колшейпа gatecol.

И ворота у тебя откроются, но не закроются. На closeagates повесь ивент onColShapeLeave

Link to comment

Прописал gatecol все как ты сказал все ровно не открываются(

local gate = createObject(8210,2497.8999023438,2769.3999023438,12.89999961853, 0, 0, 270.25 ) 
gatecol = createColCircle ( 8210,2497.8999023438, 2769.3999023438, 25 ) --Co-Ordinates "X" and "Y" and the radius, I use 15 as default. 
  
function openagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will open only if the player is in the male staff skin 
        moveObject ( gate, 6000, 2497.8999023438, 2769.3999023438, 4.0999999046326 ) --The speed in which 7000 is slow and 2000 is fast to open, Co-Ordinates for the gate to move to. 
        end 
end 
addEventHandler( "onColShapeHit", gatecol, openagates ) 
  
function closeagates(thePlayer) 
        if getElementModel( thePlayer ) == 217 then --Will close only if the player is in the male staff skin 
       moveObject (gate1, 6000, 2497.8999023438, 2769.3999023438, 12.89999961853) --The speed in which 7000 is slow and 1000 is fast to open, Co-Ordinates for the gate to close. 
        end 
end 
  

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