First of all, you can't use HTML tags in Lua.
<pre class="brush: lua">
</pre>
Also, you can't put 2 in game.Players:GetPlayers(2). GetPlayers() is a function that gives you a table of the Players. It doesn't have any parameters.
I've added some annotations so you can read what is happening.
local allPlayers = game.Players:GetPlayers()
math.randomseed(tick())
local val1 = math.random(1, #allPlayers)
local val2;
repeat val2 = math.random(#allPlayers)
until val2 ~=val1
allPlayers[val1].Character.Torso.CFrame = CFrame.new (0,0,0)
allplayers[val2].Character.Torso.CFrame = CFrame.new(665.995,7.1,-115.005)
Also keep in mind this script will not work very well if there is only 1 player in the server. Be sure the script doesn't run unless there are two players in the server. I recommend checking the value of NumPlayers
if game.Players.NumPlayers > 1 then
end
4 comments
its not changing into lua form sorry ):
Select the whole script, press the Lua button. There should be one row of tildes (~~~~) above and one row below. You can edit your post by pressing the button at the right.
now i got it :D thank you
i got in in lua form ( i didnt fix the problem) ):