easyrider Posted July 30, 2017 Share Posted July 30, 2017 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
Mr.Loki Posted July 30, 2017 Share Posted July 30, 2017 Please use the code button when posting code. If you checked your debug you'd know that u have a typo on line 8. Link to comment
easyrider Posted July 30, 2017 Author Share Posted July 30, 2017 Mr.Loki please give me example. ı am newbie about scripts.can you write for me ? ı dont know what ı will add on 8 line. Link to comment
Anubhav Posted July 30, 2017 Share Posted July 30, 2017 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) Link to comment
easyrider Posted July 30, 2017 Author Share Posted July 30, 2017 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
Shayan816 Posted July 30, 2017 Share Posted July 30, 2017 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
Mr.Loki Posted July 30, 2017 Share Posted July 30, 2017 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
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