Nighttrain Posted March 17, 2015 Share Posted March 17, 2015 hello guys i am looking for a Teleport system i need something like the Interior file's that yellow arrow stuff i look around on the community but cant find a good working script i got an errorcode on 1 of the Scripts ERROR: Loading script failed: addelevator/elevator.lua:5: unexpected symbol near '=' i look in to the Elevator script but all is looking good can someone help me to fix it? or you got a good one? send it me please Link from Elevator system : https://community.multitheftauto.com/in ... ls&id=6647 Also this topic is in Resources! Link to comment
Nighttrain Posted March 17, 2015 Author Share Posted March 17, 2015 https://community.multitheftauto.com/in ... ls&id=6647 Link to comment
Ryancit2 Posted March 18, 2015 Share Posted March 18, 2015 That code contains something incomplete, just remove Line#4 from elevator.lua file, Line#4 is this: local model = Remove that and then try. Link to comment
Nighttrain Posted March 18, 2015 Author Share Posted March 18, 2015 That code contains something incomplete, just remove Line#4 from elevator.lua file, Line#4 is this: local model = Remove that and then try. i go try it much guys helps already with this but on much changes the error stays i tell you As soon As Posible when i got a result or still the error Link to comment
Nighttrain Posted March 18, 2015 Author Share Posted March 18, 2015 the error is now [16:24:56] ERROR: addelevator/elevator.lua:4: attempt to perform arithmetic on l ocal 'x2' (a string value) Link to comment
TAPL Posted March 18, 2015 Share Posted March 18, 2015 This script is badly scripted, i improved it. function elevator(player, cmd, x1, x2, x3, col1, col2, col3, alpha, size) local x1, x2, x3, col1, col2, col3, alpha, size = tonumber(x1), tonumber(x2), tonumber(x3), tonumber(col1), tonumber(col2), tonumber(col3), tonumber(alpha), tonumber(size) if x1 and x2 and x3 and col1 and col2 and col3 and alpha and size then local x, y, z = getElementPosition(player) local marker1 = createMarker(x, y, z + 1, "arrow",2, col1, col2, col3, alpha) setElementData(marker1, "Pos", {x1, x2 + 2, x3}) addEventHandler("onMarkerHit", marker1, function(hitPlayer) if getElementType(hitPlayer) == "player" then local x, y, z = unpack(getElementData(source, "Pos")) setElementPosition(hitPlayer, x, y, z) fadeCamera(hitPlayer, false, 0.1, 255, 0, 0) setTimer(fadeCamera, 500, 1, hitPlayer , true, 0.5) end end) local marker2 = createMarker(x1, x2, x3 + 1, "arrow", size, col1, col2, col3, alpha) setElementData(marker2, "Pos", {x, y + 2, z}) addEventHandler("onMarkerHit", marker2, function(hitPlayer) if getElementType(hitPlayer) == "player" then local x, y, z = unpack(getElementData(source, "Pos")) setElementPosition(hitPlayer, x, y, z) fadeCamera(hitPlayer, false, 0.1, 255, 0, 0) setTimer(fadeCamera, 500, 1, hitPlayer , true, 0.5) end end) else outputChatBox("[invalid Syntax]: /addelevator [x], [y], [z], [Col1], [Col2], [Col3], [Alpha], [size] ", player, 255, 0, 0) end end addCommandHandler("addelevator", elevator) Link to comment
Nighttrain Posted March 18, 2015 Author Share Posted March 18, 2015 TAPL thanks for your reaction i got no errors now but now is my question What do i need to fill in at Alpha? can you make a kind of tutorial what i need to fill in? because now i need to fill this /addelevator [x], [y], [z], [Col1], [Col2], [Col3], [Alpha], the XYZ is 100% clear that is location 1 i think COl 1,2,3 is i think second location (i am wrong or?) and now Alpha ????? size is marker size? or ? Link to comment
TAPL Posted March 18, 2015 Share Posted March 18, 2015 First location is where you were stand at the time you used the command which the second location is what you write within the command, Col1, Col2 and Col3 is rgb color of the marker (number between 0 and 255) and also the alpha 0-255, the size is the size of the marker. No comma is needed when you use the command. Link to comment
Nighttrain Posted March 18, 2015 Author Share Posted March 18, 2015 okay i got one now, but how to teleport back from it? with the same /addelevator to create a other one or? Link to comment
TAPL Posted March 18, 2015 Share Posted March 18, 2015 It create two markers one of them to teleport back. Link to comment
Nighttrain Posted March 18, 2015 Author Share Posted March 18, 2015 it will not work in a interior now can you maybe make a option for that or? Link to comment
TAPL Posted March 19, 2015 Share Posted March 19, 2015 I made enough code, now your turn to add more features. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now