Jump to content
Mr. Green Gaming

Script request: Teleport


besweeet

Recommended Posts

Trying to get the teleportation stuff going in Awesome Coaster 2, but I'm having some issues.

I tried Emanuel's/Bin's script here (also pasted below), but it doesn't work. What you're seeing here is my code:

addEvent('onPlayerReachCheckpoint', true)
addEventHandler('onPlayerReachCheckpoint', getRootElement(),
function(checkpoint)
if checkpoint == 3 then
x,y,z = getElementVelocity(getPedOccupiedVehicle(source))
setElementPosition(getPedOccupiedVehicle(source), 1256.3970947266, -616.40679931641, 102.78839874268)
setElementRotation(getPedOccupiedVehicle(source), 0, 0 , 90)
setElementVelocity(getPedOccupiedVehicle(source), 0,y,0)
end
end
)

I basically changed the checkpoint number and the coordinates, but it doesn't work. Yes, I added the "<script src="teleport.lua" type="client" />" line in my meta.xml file.

It's simply not working. When I hit the checkpoint, I'm expecting it to take me to the new location, but it doesn't do anything at all.

Any ideas? Would rather stick to using checkpoints instead of individual markers.

Edited by besweeet
Link to comment

Yes, I added the "<script src="teleport.lua" type="client" />" line in my meta.xml file.

You seem so sure of yourself I actually hate to break it to you, but it's type="server"

:P :P

Ah, I'll try that when I get home in a few hours.

Why would it be server instead of client? Couldn't really find any descriptive answers.

Link to comment

I set it to server, and it worked. BUT, right when I spawn at my new point, my car immediately flies up in the air and spins around a bunch. I tried setting it to be higher, but it doesn't seem to be helping.

Also, how the FUCK do I remove the motion blur from the MTA map editor when testing a map? SO. FUCKING. ANNOYING.

Link to comment

remove this line

setElementVelocity(getPedOccupiedVehicle(source), 0,y,0)

it doesn't generally work, you need to tweak the 0,y,0 arguments for each particular case and you probably just shouldn't use velocity at all, just use the other script codes that teleport the car (again, no need for that velocity line)

post again if it still doesn't work as you might need to also freeze the car after teleporting (i'll help with this if it doesnt work)

Link to comment

remove this line

setElementVelocity(getPedOccupiedVehicle(source), 0,y,0)

it doesn't generally work, you need to tweak the 0,y,0 arguments for each particular case and you probably just shouldn't use velocity at all, just use the other script codes that teleport the car (again, no need for that velocity line)

post again if it still doesn't work as you might need to also freeze the car after teleporting (i'll help with this if it doesnt work)

I removed the line altogether, and the car still flies into the air. The slower the car seems to go when you hit the initial checkpoint, the crazier the car will get.

Also, how the FUCK do I remove the motion blur from the MTA map editor when testing a map? SO. FUCKING. ANNOYING.

You can change the settings for race in the admin panel, or in race's meta.xml

<setting name="*blur" value="36" 

to

 value="0"

Works :D. LOVE YA! Not working... I don't love you anymore. Just kidding... Of course I do! :D

I noticed that the line that has the blur setting in it keeps getting removed when testing a map... Lastly, I don't get an admin panel in the MTA map editor. Had to do start admin in the console. Works now :).

Edited by besweeet
Link to comment

Also, the custom wheels and tires on my custom car (replacing the Infernus) don't show up until I die and respawn. The stock wheels and tires from the Infernus are what show up by default for some reason. I read that adding upgrades="0" to the spawnpoint for the car would fix it, but then MTA would get stuck at loading the map and wouldn't do anything, even after I clear the line out.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...