Thivenin Posted August 1, 2013 Share Posted August 1, 2013 hai, I'm learning the script and I start with the teleporting with marker But when I come in my interior I have the marker to get out, when I take it but it's doing nothing so my first function is working well but not the secound for get back to normal dimension I have the error, line 12 : 'then' excepted near 'hitElement' here the script : intoMarker = createMarker ( 1153, -1770, 18, "arrow", 1.5, 250, 0, 0, 250 ) function intoTeleport ( player ) setElementInterior ( player, 900, 26, 42, 121 ) end addEventHandler ( "onMarkerHit", intoMarker, intoTeleport ) outMarker = createMarker ( 24, 42, 122.5, "arrow", 1.5, 250, 0, 0, 255 ) setElementInterior(outMarker,900) function outTeleport( hitElement, matchingDimension ) if ( "thePlayer" ) hitElement ( hitMarker ) then local elementType = getElementType( hitElement )type setElementDimension ( source, 0 ) end end addEventHandler( "onMarkerHit", outMarker, outTeleport ) IntoMarker and the function intoTeleport is the function for get in the interior, that is working the problem is the outMarker and the function outTeleport so my problem is : I can't get my ass back to the normal dimension, can ya all help me pls ? Link to comment
aim-killer Posted August 1, 2013 Share Posted August 1, 2013 your if statement is wrong .. i think you are trying to make it like this : if (hitElement == "player") then -- bla bla bla end and by the way changing the dimension wont get the player out Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 This time I tried it : outMarker = createMarker ( 24, 42, 122.5, "arrow", 1.5, 250, 0, 0, 255 ) setElementInterior(outMarker,900) function outTeleport ( hitElement, matchingDimension, player ) if (hitElement == "player") then setElementDimension ( source, 0 ) setElementPosition ( player, 1155, -1770, 18 ) end end The marker is here, there is no any error message but when I take the marker it's not teleporting and there is still no error Link to comment
aim-killer Posted August 1, 2013 Share Posted August 1, 2013 Its better if you use "onPlayerMarkerHit" because its only triggered when a player hits a marker onPlayerMarkerHit -- triggered only when a player enters a marker markerHit -- the marker that got hit matchingDimension -- if its in the same dimension as the hit player source -- is the player who got hit by the way when changing element interior it dose not change the dimension, it stays the same intoMarker = createMarker ( 1153, -1770, 18, "arrow", 1.5, 250, 0, 0, 250 ) function intoTeleport (markerHit, matchingDimension) if (markerHit == intoMarker) then hitplayer = source setElementInterior ( hitplayer, 900, 26, 42, 121 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), intoTeleport ) outMarker = createMarker ( 24, 42, 122.5, "arrow", 1.5, 250, 0, 0, 255 ) setElementInterior(outMarker,900) function outTeleport (markerHit, matchingDimension) if markerHit == outMarker then hitplayer = source setElementInterior ( hitplayer , 0 ) setElementPosition ( hitplayer , 1155, -1770, 18 ) end end addEventHandler( "onPlayerMarkerHit", getRootElement(), outTeleport ) Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 I added your last "end" that you forgot still not working, not any error Link to comment
aim-killer Posted August 1, 2013 Share Posted August 1, 2013 there is no end i missed and its working by the way there is not interior 900 i think you wanted to change the dimension to 900 not interior on marker hit and can you post your current code ? and explain what you want ur script to happen Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 The 900 is an interior so it's not really changing the dimension I want to have a marker wich is teleporting you to the normal dimension/world Link to comment
aim-killer Posted August 1, 2013 Share Posted August 1, 2013 (edited) interior: The interior you want to set the element to. Valid values are 0 to 255. https://wiki.multitheftauto.com/wiki/SetElementInterior Edited August 1, 2013 by Guest Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 Erm Im teleported to mymapping with the 900 Link to comment
aim-killer Posted August 1, 2013 Share Posted August 1, 2013 (edited) try this.. it works but spawns on air and kills me but i think its what u wanted intoMarker = createMarker ( 1153, -1770, 18, "arrow", 1.5, 250, 0, 0, 250 ) function intoTeleport (markerHit, matchingDimension) if (markerHit == intoMarker) then hitplayer = source setElementInterior ( hitplayer, 900, 26, 42, 121 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), intoTeleport ) outMarker = createMarker ( 24, 42, 122.5, "arrow", 1.5, 250, 0, 0, 255 ) setElementInterior(outMarker,900) function outTeleport (markerHit, matchingDimension) if markerHit == outMarker then hitplayer = source setElementInterior ( hitplayer , 0, 1155, -1770, 18 ) end end addEventHandler( "onPlayerMarkerHit", getRootElement(), outTeleport ) edit: when i check the interior from admin panel its 132 Edited August 1, 2013 by Guest Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 Im actualy not on the computer, I will try when Im back Link to comment
Thivenin Posted August 1, 2013 Author Share Posted August 1, 2013 that is working, thanks you very much Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 I have another problem now, this one is very weird firstMarker = createMarker ( -35, 35, 121.5, "arrow", 250, 0, 250, 255 ) setElementInterior ( firstMarker, 900 ) function firstTP ( markerhit, matchingDimension ) if ( markerhit == firstMarker ) then hitplayer = source setElementInterior ( hitplayer, 901, -214, 16, 197 ) end end addEventHandler ( "onPlayerMarkerHit", firstMarker, firstTP ) the marker should be at the interior "900" and I should take the marker for being TP at the interior 901, but when I get in the interior 900, it's directly TPing le at the interior 901, I tried alot of thing but nothing help me pls ^^ (again sorry for all thse ask, I started the script yesterday edit : now as I removed "getRootElement()" and added "firstMarker" at the event, it's not TPing me directly at the interior 901, it's TPing correctly at the interrior 900, but I don't see the marker to go at the interior 901 Link to comment
Castillo Posted August 2, 2013 Share Posted August 2, 2013 firstMarker = createMarker ( -35, 35, 121.5, "arrow", 250, 0, 250, 255 ) setElementInterior ( firstMarker, 900 ) function firstTP ( markerhit, matchingDimension ) if ( markerhit == firstMarker ) then setElementInterior ( source, 901, -214, 16, 197 ) end end addEventHandler ( "onPlayerMarkerHit", root, firstTP ) Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 that doesn't work, now it's TPing me again at the interior 901 Link to comment
Castillo Posted August 2, 2013 Share Posted August 2, 2013 Well, that's obviously... is what your script does. Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 yes, lol but I should first enter in the interior 900 to take the marker to go to the interior 901, but when I take the marker to go to the interior 900 it's directly TPing me at the interior 901 so when I wanna go to the interior 900, I can't because of that part of the script is bugged and TPing me directly at interior 901 Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 bump firstMarker = createMarker ( -35, 35, 121.5, "arrow", 250, 0, 250, 255 ) setElementInterior ( firstMarker, 900 ) function firstTP ( markerhit, matchingDimension ) if ( markerhit == firstMarker ) then hitplayer = source setElementInterior ( hitplayer, 901, -214, 16, 197 ) end end addEventHandler ( "onPlayerMarkerHit", firstMarker, firstTP ) with it, it's TPing me well to interior 900, but I can't see the marker if I put "getRootElement()" or "root" at EventHandler, it's making the script bugged Link to comment
xXMADEXx Posted August 2, 2013 Share Posted August 2, 2013 Thats because your setting the marker interior to 900 and the player to 901... Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 what you mean ? give the script pls ^^ edit : Solved, I just forgot to put the marker size x))), sorry for loosing your time for shitty fail ^^ 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