marty000123 Posted November 18, 2016 Share Posted November 18, 2016 (edited) Hi. marker = createMarker(-2712.5,217.6,4, "corona", 1,255,255,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle, -2722, 207, -9) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) The point of this script is to TP the player and it's vehicle to the given setElementPosition. A friend of mine made this, but we couldn't figure out why it doesn't work. When you get into the marker, you should get TP'd to the wanted destination, but it doesn't, it doesn't TP you anywhere. It doesn't work while on foot and it doesn't work when you're in a vehicle. Again, help would be very appreciated! Marty Edited November 18, 2016 by marty000123 Link to comment
iPrestege Posted November 18, 2016 Share Posted November 18, 2016 marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 ) addEventHandler ( 'onClientMarkerHit',marker, function ( aPlayer ) if aPlayer == localPlayer then local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer setElementPosition ( aMove,-2722,207,-9 ) setElementFrozen ( aMove,true ) setTimer ( setElementFrozen,1000,1,aMove,false ) end end ) Try this. Link to comment
marty000123 Posted November 19, 2016 Author Share Posted November 19, 2016 11 hours ago, iPrestege said: marker = createMarker ( -2712.5,217.6,4,'corona',1,255,255,0 ) addEventHandler ( 'onClientMarkerHit',marker, function ( aPlayer ) if aPlayer == localPlayer then local aMove = getPedOccupiedVehicle ( aPlayer ) or aPlayer setElementPosition ( aMove,-2722,207,-9 ) setElementFrozen ( aMove,true ) setTimer ( setElementFrozen,1000,1,aMove,false ) end end ) Try this. Hi, thanks for the help. Sadly, it didn't work. It didn't give me a warning/error in debugscript 3, but it just doesn't want to RP me or my car. http://imgur.com/a/D9OGY Link to comment
marty000123 Posted November 19, 2016 Author Share Posted November 19, 2016 <meta> <info author="Maarten" type="map" version="2.0.0"></info> <script src="MaartenGarageScript.lua" type="server"></script> </meta> Link to comment
pa3ck Posted November 19, 2016 Share Posted November 19, 2016 Yeah.. it's not a server side script change it to type client. Link to comment
marty000123 Posted November 19, 2016 Author Share Posted November 19, 2016 1 hour ago, pa3ck said: Yeah.. it's not a server side script change it to type client. Thanks for the tip, it now works! But there's just one major issue, it only TP's when I'm on foot and it doesn't TP me and my car when I'm inside of a vehicle, which is the point of this script. Help? Link to comment
LoPollo Posted November 19, 2016 Share Posted November 19, 2016 (edited) It's strange it does not work, through i did not test it. Are there errors clientside? I'm going to test ASAP Update: It works for me, i used @iPrestege code. No errors and both on foot and inside veh trigger the teleport Edited November 19, 2016 by LoPollo 1 Link to comment
marty000123 Posted November 20, 2016 Author Share Posted November 20, 2016 It works, stupid me, thanks Link to comment
iPrestege Posted November 20, 2016 Share Posted November 20, 2016 No problem .You are welcome. 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