Jump to content

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


montenegro11

Recommended Posts

Posted

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

Posted

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.

Posted

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) 

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

Posted

That script you've brought to me, it brings me these warnings, what do I do? And yeah, yesterday I came up with an idea to get mta server. so dont judge me hahCNZ38jn.png

I'm totally helpless am I?

Posted

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

Posted (edited)

Yes, let me try to do that again, but I'm not sure that it will fix the problem

EDIT: Well, no errors appear, but the gate doesn't open, can you check the script? And yeah, can it be due to too long command?

Edited by Guest
Posted

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

Posted

Well, I might not know the coordinates but can you edit the script so it goes like this, this is where the gate is supposed to be:

x:2403

y:-1658

z:15

I might have messed it up, can you edit the script so it goes like this?

Posted
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 ) 

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