WallMart

simple marker teleport?

Recommended Posts

hey, im looking for a simple teleport script that makes use of markers, just to get somewhere quickly... im a total noob at scripting so help would be appreciated :)

thx in advance ;)

Share this post


Link to post
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )
 
function MarkerHit( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, posX, posY, posZ )
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit )

Share this post


Link to post
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )
 
function MarkerHit( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, posX, posY, posZ )
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit )

.... i dont understand a thing about this?"can i just put in a file and save it and my teleporter will work?(read:im a total noob at scripting)

Share this post


Link to post

but well the problem is that i couldnt understand one of these tutorials :( i hoped someone just had this simple script ready to be used and just with an easy explanation of what i have to fill in to get the portals connected ;)

Share this post


Link to post
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 )
 
function MarkerHit( hitPlayer, matchingDimension )
setElementPosition ( hitPlayer, posX, posY, posZ )
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit )

.... i dont understand a thing about this?"can i just put in a file and save it and my teleporter will work?(read:im a total noob at scripting)

local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) -- This one creates a marker with cylinder form at x,y,z coordinates and makes marker red.
 
function MarkerHit( hitPlayer, matchingDimension ) -- This line creates a function with 2 arguments hitPlayer and matchingDimension (I don't know very much about arguments).
 
setElementPosition ( hitPlayer, posX, posY, posZ ) -- This line teleports hitPlayer ( player that hits marker) to posX, posY and posZ coordinates.
 
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- This is event handler read about it at [url=http://robhol.net/guide/basics/?p=8]http://robhol.net/guide/basics/?p=8[/url]

And... Yes you can save it and start the server, but first you need to save this in a lua file and make it server side in meta.xml.

Share this post


Link to post

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.