Jump to content

Randomly Teleport Tp PvP places


Recommended Posts

 

Hi Friends,

I want to teleport to different places when I write / pvp command.

I write some codes. It says 'RUNNING' in the resources.but It is not teleporting :C    Help me please ...

serverside :

local spawns = {
{ -1569.2819824219, 1196.4373779297, 7.1865711212158, 0 },
{ -1661.0703125, 1212.8386230469, 32.897026062012, 0 },
{ -1684.5240478516, 1360.486328125, 7.1721897125244, 0 },
{ -1768.2357177734, 1175.0441894531, 25.125, 0 }
}
function spawn( player )
local rnd = mat.random( 1, #spawns )
setElementPosition( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3] )
setElementPosition( player, 0 , 0, spawns[rnd][4] )
end
addCommandHandler("pvp",Spawn)

 

Meta File:

<meta>
<script src="server.lua" type="server" />
</meta>

What is wrong ??? 

 

 

 

Link to comment

local spawns = {
{ -1569.2819824219, 1196.4373779297, 7.1865711212158, 0 },
{ -1661.0703125, 1212.8386230469, 32.897026062012, 0 },
{ -1684.5240478516, 1360.486328125, 7.1721897125244, 0 },
{ -1768.2357177734, 1175.0441894531, 25.125, 0 }
}
function spawn( player )
    local rnd = math.random( 1, #spawns )
    setElementPosition( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3] )
    setElementPosition( player, 0 , 0, spawns[rnd][4] )
end
addCommandHandler("pvp",spawn)

 

 

Bro ı did try but its warp to me at BLUBERRY TOWN and just 1 warp.

Link to comment
local spawns = {
{ -1569.2819824219, 1196.4373779297, 7.1865711212158, 90 },
{ -1661.0703125, 1212.8386230469, 32.897026062012, 90 },
{ -1684.5240478516, 1360.486328125, 7.1721897125244, 90 },
{ -1768.2357177734, 1175.0441894531, 25.125, 90 }
} 
function spawn( player )
local rnd = math.random( 1, #spawns )
setElementPosition( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3] )
end
addCommandHandler("pvp",spawn)

 

Link to comment
9 hours ago, easyrider said:

local spawns = {
{ -1569.2819824219, 1196.4373779297, 7.1865711212158, 0 },
{ -1661.0703125, 1212.8386230469, 32.897026062012, 0 },
{ -1684.5240478516, 1360.486328125, 7.1721897125244, 0 },
{ -1768.2357177734, 1175.0441894531, 25.125, 0 }
}
function spawn( player )
    local rnd = math.random( 1, #spawns )
    setElementPosition( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3] )
    setElementPosition( player, 0 , 0, spawns[rnd][4] )
end
addCommandHandler("pvp",spawn)

 

 

Bro ı did try but its warp to me at BLUBERRY TOWN and just 1 warp.

1

 

it's because you have setElementPosition twice the second function should be setElementRotation( player, 0 , 0, spawns[rnd][4] )

Link to comment

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.
×
×
  • Create New...