Jump to content

Help me, a small problem but Idk how to fix it


montenegro11

Recommended Posts

gate = createObject(980, 551.5, 1659.300488281, 8.8000001907349, 0, 0, 121.99768066406) 
  
function gateOpen() 
moveObject( gate, 2000, 551.59997558594, 165.1999511719, 14.30000190735 ) 
end 
addCommandHandler("grovegateo", gateOpen) 
  
function gateClose() 
moveObject( gate, 2000, 551.59997558594, 165.1999511719, 14.30000190735 ) 
end 
addCommandHandler("grovegatec", gateClose) 

This is the script for gates, it's working on other computers but on mine there's a problem. I don't know where to put this script, I have it in .lua file, and it's ok. now I don't want it as a resource because every time I'll have to /start resourcename and it's pissing me. Now, if somebody knows, where will I put the .lua file, or where will I import this "script" The help would be appreciated

Link to comment

First, go to your server directory and go to "resources" folder.

Create a new folder inside called "gate", inside this folder, create a "meta.xml" file and paste the code I gave above, then create another file called "myScript.lua" and paste your gate script inside.

Link to comment

I've made some adjustments, and changed the gate towards the Grove Street, probbably messed up something, mind to check it?

gate = createObject(2403, 1658, 15 ) 
  
function gateOpen() 
moveObject( gate, 2403, 1658, 7 ) 
end 
addCommandHandler("grovegateo", gateOpen) 
  
function gateClose() 
moveObject( gate, 2403, 1658, 15) 
end 
addCommandHandler("grovegatec", gateClose) 

Link to comment
gate = createObject ( 2403, 1658, 15 ) 
  
function gateOpen ( ) 
    moveObject ( gate, 2000, 2403, 1658, 7 ) 
end 
addCommandHandler ( "grovegateo", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gate, 2000, 2403, 1658, 15 ) 
end 
addCommandHandler ( "grovegatec", gateClose ) 

You forgot to fill the 'time' argument from moveObject.

Link to comment

Testing it out, don't you go afk on me, I've got to make a surprise gate for my friend.

Aaaand it doesn't work. Still this error and the script is:

gate = createObject ( 980, 2403, 1658, 15 ) 
  
function gateOpen ( ) 
    moveObject ( gate, 2000, 2403, 1658, 7 ) 
end 
addCommandHandler ( "grovegateo", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gate, 2000, 2403, 1658, 15 ) 
end 
addCommandHandler ( "grovegatec", gateClose ) 

Xv5xrUF.jpg

Link to comment

I really don't know. I really don't know what's going on, let me change the command to gso and gsc

gate = createObject ( 980, 2403, 1658, 15 ) 
  
function gateOpen ( ) 
    moveObject ( gate, 2000, 2403, 1658, 7 ) 
end 
addCommandHandler ( "gso", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gate, 2000, 2403, 1658, 15 ) 
end 
addCommandHandler ( "gsc", gateClose ) 

give me 2 minutes to test it

Link to comment
gate = createObject ( 980, 2403, -1658, 15, 0, 0, 90 ) 
  
function gateOpen ( ) 
    moveObject ( gate, 2000, 2403, -1658, 7 ) 
end 
addCommandHandler ( "gso", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gate, 2000, 2403, -1658, 15 ) 
end 
addCommandHandler ( "gsc", gateClose ) 

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