local allPlayers = {} for a,v in pairs(game.Players:Getchildren()) do table.insert(allPlayers,v) end local plrAmount = game.Players.Numplayers local val1 = math.random(plrAmount) local val2 repeat val2 - math.random(plrAmount) wait(20) 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) math.randomseed(os.time())
it says Workspace.Script:9: '=' expected near '-' im not sure what to do
val2 = val2 - math.random(plrAmount)
The variable is an integer value. To subtract, add, multiply, or divide a variable set as an integer, you must reset the variable. Resetting the variable is just like setting it in the first place. Except you do it like above, where you set the variable as itself, minus another variable, integer, or in this case, math.